Adler-32
Adler-32 is a 32-bit checksum designed by Mark Adler; faster to compute than CRC32 but slightly weaker at error detection, used for zlib compression stream integrity.
Purpose
Provides a checksum faster than CRC32 for performance-sensitive compression stream integrity verification.
Mechanism
A = 1 + Σd_i (mod 65521), B = Σ(1 + Σ_{j≤i} d_j) (mod 65521), output B<<16 | A. The modulus 65521 (largest prime below 65536) ensures good distribution.
Use cases
- zlib/gzip stream verification
- PNG IDAT checksums
- Real-time compression integrity
- Low-overhead checksum scenarios
Examples
- Input
helloOutput0x062c0215Slightly weaker than CRC32 but faster
Common errors
- Adler-32 error-detection degrades significantly on short inputs
- Use CRC32 for short data
Related terms
CRC32
CRC32 is a 32-bit cyclic redundancy check based on polynomial division over GF(2), used to detect transmission errors — not a cryptographic hash. GLOSSARY
MD5
MD5 is a 128-bit cryptographic hash function designed by Ronald Rivest; proven insecure by collision attacks, it is now used only for non-security purposes such as checksums. GLOSSARY