To check the CRC, instead of calculating the CRC on the message and comparing it to the CRC, a CRC calculation may be run on the entire codeword. If the result (called the residual) is zero, the check passes. This works because the codeword is , which is always divisible by .

There are several standard variations on CRCs, any or all of which may be used with any CRC polynomial. Implementation variations such as endianness and CRC presentation only affect the mapping of bit strings to the coefficients of and , and do not impact the properties of the algorithm.


In practice, the last two variations are invariably used together. They change the transmitted CRC, so must be implemented at both the transmitter and the receiver. While presetting the shift register to ones is straightforward to do at both ends, inverting affects receivers implementing the first variation, because the CRC of a full codeword that already includes a CRC is no longer zero. Instead, it is a fixed non-zero pattern, the CRC of the inversion pattern of ones.


The CRC thus may be checked either by the obvious method of computing the CRC on the message, inverting it, and comparing with the CRC in the message stream, or by calculating the CRC on the entire codeword and comparing it with an expected fixed value , called the check polynomial, residue or magic number. This may be computed as , or equivalently by computing the unmodified CRC of a message consisting of ones, .


These inversions are extremely common but not universally performed, even in the case of the CRC-32 or CRC-16-CCITT polynomials.

Reversed representations and reciprocal polynomials[edit]

Polynomial representations[edit]

Example of CCITT 16-bit Polynomial in the forms described (bits inside square brackets are included in the word representation; bits outside are implied 1 bits; vertical bars designate nibble boundaries):

Because a CRC is based on division, no polynomial can detect errors consisting of a string of zeroes prepended to the data, or of missing leading zeroes. However, see .

Variations

All single bit errors will be detected by any polynomial with at least two terms with non-zero coefficients. The error polynomial is , and is divisible only by polynomials where .

All two bit errors separated by a distance less than the of the primitive polynomial which is a factor of the generator polynomial will be detected. The error polynomial in the two bit case is . As noted above, the term will not be divisible by the CRC polynomial, which leaves the term. By definition, the smallest value of such that a polynomial divides is the polynomial's order or exponent. The polynomials with the largest order are called primitive polynomials, and for polynomials of degree with binary coefficients, have order .

order

All errors in an odd number of bits will be detected by a polynomial which is a multiple of . This is equivalent to the polynomial having an even number of terms with non-zero coefficients. This capacity assumes that the generator polynomial is the product of and a primitive polynomial of degree since all primitive polynomials except have an odd number of non-zero coefficients.

All of length will be detected by any polynomial of degree or greater which has a non-zero term.

burst errors

Barrett reduction

Error correcting code

List of checksum algorithms

Parity (telecommunication)

Polynomial representations of cyclic redundancy checks