Calculating CRC-CCITT (Kermit) on two different sites, gives different results

445 Views Asked by At

I was playing around with CRC-CCITT (Kermit), and I noticed that when calculating the checksum on different sites, I got different results.

On lammertbies.nl/comm/info/crc-calculation.html the result of 123456789 was 0x8921, but on crccalc.com it was 0x2189.

In fact whatever value you enter the result on crccalc is the same as lammertbies, but with the last two characters first. So foobar on lammertbies is 0xF4E3, but on crccalc is 0xE3F4.

Which site is correct, and what is the other site doing wrong?

1

There are 1 best solutions below

3
On BEST ANSWER

This is an issue of big endian versus little endian in the reported CRC value.

You can verify most implementations of CRC by appending the CRC to a string and checking the appended string for CRC == 0. Go back to both of the CRC calculator web sites, change the input to hex, enter the hex string

"3132333435363738398921"

and the Kermit CRC will be 0000, so the CRC as appended to the string would be 0x89, 0x21.