forked from nanoframework/nanoFramework.IoT.Device
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Helper.cs
33 lines (29 loc) · 937 Bytes
/
Helper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Iot.Device.Card.Mifare
{
internal static class Helper
{
/// <summary>
/// Compare the elements of 2 different byte arrays
/// </summary>
/// <param name="first">First array to compare</param>
/// <param name="second">Second array to compare</param>
/// <returns>True if all elements are equa</returns>
public static bool SequenceEqual(this byte[] first, byte[] second)
{
if (first.Length != second.Length)
{
return false;
}
for (int i = 0; i < first.Length; i++)
{
if (first[i] != second[i])
{
return false;
}
}
return true;
}
}
}