CRC32
Also known as: crc32 checksum, cyclic redundancy check, crc32, crc-32
CRC32 is a 32-bit cyclic redundancy check that produces a short checksum of a file or data block to detect accidental corruption. It is fast and widely used in formats like ZIP and PNG, but it is an error-detection code, not a secure or cryptographic hash.
- Produces a 32-bit checksum from polynomial division of the input, designed to detect accidental corruption.
- Used in common formats such as ZIP entries and PNG chunks for fast integrity checks.
- Not cryptographic or collision-resistant — use SHA-256 for security or for confirming true duplicates.
What CRC32 does
A cyclic redundancy check treats the input bytes as a large binary number and divides it by a fixed polynomial; the 32-bit remainder is the CRC32 value. In practice this is implemented with fast table lookups or hardware instructions, so it can checksum large files at high speed.
Its purpose is integrity verification against accidental errors — bit flips from storage, transmission, or a truncated copy. Recompute the CRC32 of the data and compare it to the stored value; if they differ, the data changed. This is why ZIP archives store a CRC32 per entry and PNG stores one per chunk.
Where it fits — and where it doesn't
CRC32 is excellent at catching random corruption, but it is not collision-resistant and is easy to forge deliberately, so it must never be used for security, deduplication you can't tolerate errors in, or proof that two files are identical. For those cases a cryptographic hash such as SHA-256 is appropriate.
In file-management contexts, CRC32 is a good cheap first pass: if two files have different CRC32 values they are definitely different, which can quickly rule out non-duplicates. A confirmed match should then be validated with a stronger hash or a byte-for-byte comparison before any file is deleted.