public Crc16_Kermitt(Crc16Mode mode) { ushort polynomial = (ushort)mode; ushort value; ushort temp; for (ushort i = 0; i < table.Length; ++i) { value = 0; temp = i; for (byte j = 0; j < 8; ++j) { if (((value ^ temp) & 0x0001) != 0) { value = (ushort)((value >> 1) ^ polynomial); } else { value >>= 1; } temp >>= 1; } table[i] = value; } }
public Crc16(Crc16Mode mode) { ushort polynomial = (ushort)mode; ushort value; ushort temp; for (ushort i = 0; i < table.Length; ++i) { value = 0; temp = i; for (byte j = 0; j < 8; ++j) { if (((value ^ temp) & 0x0001) != 0) { value = (ushort)((value >> 1) ^ polynomial); } else { value >>= 1; } temp >>= 1; } table[i] = value; } }
public Crc16(Crc16Mode Mode) { BuildCrcTable((ushort)Mode); }
public Crc16(Crc16Mode Mode) { BuildCrcTable((ushort)Mode); }