The algorithm used to compute the two different CRC’s are described below.
This algorithm can be used to compute both CRC8 and CRC16. The only difference is the width of the CRC shift register (eight bits for CRC8, 16 bits for CRC16) and the value of the polynomial. This number will simulate the connection of the XOR gates in hardware. The value of the polynomial is 18h for CRC8 and 4002h for CRC16.
The algorithms are implemented to find the CRC value of one byte at a time, but a CRC “seed” can be passed as an argument to the CRC routines. In this way, the result of one CRC operation can be passed to the next one along with the next byte, in effect computing the CRC of an arbitrary number of bytes.
CRC checking of 64-bit identifiers is implemented in OWI_CheckRomCRC. It simply computes the CRC8 value of the first 56 bits and compares it to the last eight bits of the identifier.