namespace ERVSimulator.Protocol { public static class ChecksumHelper { public static byte Xor(byte[] data, int start, int length) { byte x = 0; for (int i = 0; i < length; i++) x ^= data[start + i]; return x; } public static byte Add(byte[] data, int start, int length) { int s = 0; for (int i = 0; i < length; i++) s += data[start + i]; return (byte)(s & 0xFF); } } }