Checksum
Adler-32
Designed by Mark Adler for zlib (1995). Adler-32 is a Fletcher-style checksum: two 16-bit running sums combined into a 32-bit output. It is faster than CRC-32 by a wide margin but noticeably weaker for short inputs , the trade-off is deliberate for the inner loop of DEFLATE.
How it works, in one paragraph
Maintain two 16-bit accumulators, a and b, both modulo 65521 (the largest prime < 216). For each byte x: a = (a + x) mod 65521, b = (b + a) mod 65521. Output (b << 16) | a. The trailing b integrates position information so byte reordering changes the digest.
At a glance
| Output | 32 bits (8 hex chars) |
|---|---|
| Designer | Mark Adler (1995) |
| Standard | RFC 1950 (zlib) |
| Throughput | 3-10 GiB/s; very SIMD-friendly |
| Status | Non-cryptographic; weaker than CRC-32 on short inputs |
Where it shows up
- zlib / DEFLATE , every zlib stream ends with an Adler-32 of the uncompressed data.
- PNG , uses zlib internally, so PNG files inherit Adler-32 (alongside their own CRC-32 chunks).
- Rsync , rolling Adler variant as the fast pass in the delta-transfer algorithm.
Limitations
- For inputs under a few hundred bytes, Adler-32’s effective range is smaller than CRC-32’s, increasing false-positive integrity checks.
- Modulo 65521 means the running sums can’t use the full 32-bit space, slightly reducing distribution.
- Trivially collidable by an attacker; never use for adversarial integrity.
References
Visualize
Adler-32 on your input
11 bytes · 0-bit digest
Hex digest
Bit grid (0 bits, teal = 1, slate = 0)
Byte pixel art (0 bytes, hue = byte value mod 360°)
Avalanche , flipping the lowest bit of the first input byte changed 0 of 0 output bits
Quick quiz
Test yourself on adler-32
10 multiple-choice questions. Pick an answer for each, then submit to see explanations.
Q1.Who designed Adler-32?
Q2.Adler-32's two running sums are computed modulo:
Q3.Which RFC defines Adler-32 (within zlib)?
Q4.Adler-32 vs CRC-32 on short inputs:
Q5.Does PNG use Adler-32?
Q6.Is Adler-32 a cryptographic hash?
Q7.Rsync uses Adler-32 (or a rolling variant)... where?
Q8.Two running sums in Adler-32 are usually called:
Q9.Why does Adler-32 update b every byte?
Q10.Adler-32 throughput on modern CPUs?