public void Cdma2000_2() { var crc = Crc16.GetCdma2000(); crc.ComputeHash(Encoding.ASCII.GetBytes("123456789")); Assert.Equal(0x4C06, (ushort)crc.HashAsInt16); }
public void Cdma2000() { string expected = "0x4A2D"; var crc = Crc16.GetCdma2000(); crc.ComputeHash(Encoding.ASCII.GetBytes("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")); Assert.Equal(expected, $"0x{crc.HashAsInt16:X4}"); Assert.Equal(expected, "0x" + BitConverter.ToString(crc.Hash).Replace("-", "")); }