public void Dds110_2() { var crc = Crc16.GetDds110(); crc.ComputeHash(Encoding.ASCII.GetBytes("123456789")); Assert.Equal(0x9ECF, (ushort)crc.HashAsInt16); }
public void Dds110() { string expected = "0x242A"; var crc = Crc16.GetDds110(); crc.ComputeHash(Encoding.ASCII.GetBytes("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")); Assert.Equal(expected, $"0x{crc.HashAsInt16:X4}"); Assert.Equal(expected, "0x" + BitConverter.ToString(crc.Hash).Replace("-", "")); }