CRC implementation
CRC byte order and endianness
Separate calculation bit order from the byte order used to transmit or store the final CRC.
7 min read
Three different ordering questions
CRC integrations often mix up input byte order, bit-processing order inside each byte, and output byte order of the final CRC field. These are separate choices.
- • Order of bytes in the message
- • RefIn processing order within each byte
- • Order of CRC bytes on the wire
Hexadecimal display is not wire format
A calculator may display CRC-16 value 0x4B37. A protocol can transmit that value as bytes 4B 37 or 37 4B. The CRC model defines the numerical result; the protocol defines serialization.
Debugging tip
When a calculated number appears byte-swapped, compare the numeric CRC first, then inspect how the application serializes it. Do not change the polynomial or reflection settings merely to compensate for wire byte order.
Try it in the calculator
Change CRC parameters and compare standard algorithm results using the browser-based calculator.