init seeds the register, refin/refout reflect
the bit order going in and coming out, and xorout inverts the result. Two
implementations with the same polynomial and different reflection settings produce completely
different checksums — which is the usual reason a CRC "doesn't match". Modbus and CCITT both use
well-known parameter sets and are not interchangeable. Byte order on the wire is a separate
trap: Modbus transmits the CRC low byte first, so the frame ends with the bytes reversed
from how the checksum is written.
| CRC-8 (SMBus) | 0x07 | init 0x00 · refin false · refout false · xorout 0x00 · check 0xF4 |
|---|---|---|
| CRC-8/MAXIM (1-Wire) | 0x31 | init 0x00 · refin true · refout true · xorout 0x00 · check 0xA1 |
| CRC-16/MODBUS | 0x8005 | init 0xFFFF · refin true · refout true · xorout 0x0000 · check 0x4B37 |
| CRC-16/CCITT-FALSE | 0x1021 | init 0xFFFF · refin false · refout false · xorout 0x0000 · check 0x29B1 |
| CRC-16/XMODEM | 0x1021 | init 0x0000 · refin false · refout false · xorout 0x0000 · check 0x31C3 |
| CRC-16/KERMIT | 0x1021 | init 0x0000 · refin true · refout true · xorout 0x0000 · check 0x2189 |
| CRC-16/USB | 0x8005 | init 0xFFFF · refin true · refout true · xorout 0xFFFF · check 0xB4C8 |
| CRC-32 (ISO-HDLC, zip) | 0x04C11DB7 | init 0xFFFFFFFF · refin true · refout true · xorout 0xFFFFFFFF · check 0xCBF43926 |
| CRC-32/BZIP2 | 0x04C11DB7 | init 0xFFFFFFFF · refin false · refout false · xorout 0xFFFFFFFF · check 0xFC891918 |
| CRC-32C (Castagnoli) | 0x1EDC6F41 | init 0xFFFFFFFF · refin true · refout true · xorout 0xFFFFFFFF · check 0xE3069283 |
"Check" is the checksum of the ASCII string 123456789, which every catalogued
CRC publishes so an implementation can be proved correct. All ten above are reproduced by the
test suite. Note that CRC-16/MODBUS and CRC-16/USB share a polynomial and differ only in
xorout — the parameters matter as much as the polynomial does.