public void Ccitt_A() { var crc = Crc16.GetCcitt(); crc.ComputeHash(Encoding.ASCII.GetBytes("123456789")); Assert.Equal(0x2189, (ushort)crc.HashAsInt16); }
public void Crc16_Ccitt() { string expected = "DF2E"; Crc16 actualCrc = Crc16.GetCcitt(); actualCrc.Append("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", true); string actual = actualCrc.Digest.ToString("X4"); Assert.AreEqual(expected, actual); }