tags:

views:

1543

answers:

1

Does anyone know of some CRC test vectors for CRC16-CCITT?

I do not have a CRC implementation I can trust and either need to test someone's implementation or my own. (For CRC32, I use the PNG code as the gold standard, as it's a reputable reference implementation.)

(this site's CRC calculator looks useful but I need to verify correctness somehow)


UPDATE: The above CRC calculator looks useful but it takes only ascii, no way to enter hex.

I have verified this online calculator, which takes hex inputs, against the Boost test vectors for CRC16, CRC16-CCITT, and CRC32.

+1  A: 

Boost has a nice CRC implementation you can test against. As far as I know it's possible to configure it for CRC16. http://www.boost.org/doc/libs/1_41_0/libs/crc/index.html

There seems to be an example of how to set it up to simulate CCITT on this page: http://www.boost.org/doc/libs/1_41_0/libs/crc/crc.html

Laserallan
+1 and accepted: not for the reason you mentioned but because their test code has a test vector: http://www.boost.org/doc/libs/1_41_0/libs/crc/test/crc_test.cpp (see std_data and std_crc_ccitt_result)
Jason S
Great, even a blind hen sometimes finds a grain of corn :) Seriously, boost libraries tends to surprise positively.
Laserallan
implementation may be nice, and correct, but like most abstract template libraries it is pretty opaque to look at. :-(
Jason S