Adler32
Mark Adler's fast 32-bit checksum used in the zlib format
About Adler32
Adler32 is a checksum / non-cryptographic hash from the Adler-32 family. It produces a 4-byte (32-bit) output. Its registry entry cites RFC 1950. NextSSL lists it in the standard tier and exposes it through the safe API.
Overview
Adler-32 is a 32-bit checksum designed by Mark Adler for the zlib compression format, specified in RFC 1950. It is faster to compute than CRC-32 in software but detects fewer errors, particularly on short inputs. It provides no security against a deliberate attacker.
Adler-32 keeps two 16-bit sums modulo 65521, the largest prime below 2^16. A is the sum of all bytes plus one, and B is the sum of all successive values of A. The checksum is B·65536 + A. Using a prime modulus improves error detection compared with the Fletcher checksum on which it is based.
For short messages, the sums do not grow large enough to wrap around the modulus, so many bits of the checksum are poorly used and error detection is weak. zlib uses Adler-32 because speed mattered more than strength for its purpose, and rsync uses a variant as a rolling checksum.
History
1995–1996Adler-32 written by Mark Adler for zlib
Specified in RFC 1950
Security notes
Adler-32 is not cryptographic and is easy to forge. It is also a relatively weak error-detecting code for inputs shorter than a few hundred bytes.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 4 | Output |
Use it
from nextssl_demo import NextSSL
ns = NextSSL() # safe API: safe and standard tiers
value = ns.call("checksum", "adler32", None, b"123456789")[0]
nextssl_checksum("adler32", NULL, data, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_checksum_in(reg::all(), Policy::Safe, "adler32", &Params::new())?;
let value = alg.checksum(b"123456789")?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
More checksums and non-cryptographic hashes
All 130Frequently asked questions
What is Adler32?
Adler32 is a checksum in the Adler-32 family. Adler-32 is a 32-bit checksum designed by Mark Adler for the zlib compression format, specified in RFC 1950.
What are the Adler32 sizes?
In NextSSL, Adler32 uses: output 4 bytes.
Who designed Adler32 and when?
Adler32 belongs to the Adler-32 family, first published in 1995 by Mark Adler. Its origin: RFC 1950.
Which standards define Adler32?
Adler32 is referenced by RFC 1950.
Is Adler32 safe to use?
Adler32 is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.