tpircher-zz / pycrc

Free, easy to use Cyclic Redundancy Check (CRC) calculator and source code generator
https://pycrc.org
MIT License
169 stars 36 forks source link

Specification of CRC-16/CCITT initial value #7

Closed cmcqueen closed 9 years ago

cmcqueen commented 9 years ago

There is some confusion about the "correct" initial value of the 16-bit CCITT CRC. See CRC-CCITT -- 16-bit (other source) which explains it.

It has to do with the question of "augmented" zero bits at the end of the message, and an algorithm that can avoid the need for it, but needs a modification to the initial value. See Chapter 10, "A Slightly Mangled Table-Driven Implementation", of A Painless Guide to CRC Error Detection Algorithms for an explanation.

In short, perhaps pycrc's ccitt model should have an --xor-in initial value of 0x1D0F instead of 0xFFFF.

See also: