Skip to content
uencoder

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
    hello
    Output
    0x062c0215

    Slightly weaker than CRC32 but faster

Common errors

Adler-32 error-detection degrades significantly on short inputs
Use CRC32 for short data

Related terms

Related tools

References