How cyclic redundancy check works
A CRC algorithm divides the input data by a fixed polynomial and uses the remainder as the checksum. Although the division is done in binary (using XOR instead of subtraction), the process is deterministic — the same input always produces the same CRC value. If a single bit changes anywhere in the data, the remainder almost always changes too, which is why CRC is effective at detecting transmission errors.
CRC is not a cryptographic hash and is not collision-resistant in a security sense — it is designed for fast error detection, not tamper prevention. For security purposes, SHA-256 or similar algorithms are the appropriate choice.
CRC = remainder of (message × 2^r) ÷ generator polynomial
The message is treated as a binary polynomial and divided by a standard generator polynomial; the remainder is the CRC value.