2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 21:43:13 +00:00
This commit is contained in:
2020-02-26 03:14:22 +03:00
parent 7a21f6a928
commit fde1b1d8ad
39 changed files with 1108 additions and 502 deletions

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Esyur.Security.Integrity
{
public class NMEA0183
{
public static byte Compute(string data)
{
return Compute(data, 0, (uint)data.Length);
}
public static byte Compute(string data, uint offset, uint length)
{
byte rt = 0;
var ends = offset + length;
for (int i = (int)offset; i < ends; i++)
rt ^= (byte)data[i];
return rt;
}
}
}