---
title: "Adler-32"
description: "Two running sums modulo 65521. The four bytes at the end of every zlib stream"
canonical_url: "https://hashes.agntn.dev/algorithms/adler32"
---
# Adler-32

> Two running sums modulo 65521. The four bytes at the end of every zlib stream

<algorithm-facts name="adler32">



</algorithm-facts>

Mark Adler's checksum from RFC 1950. One sum of the bytes plus one, one sum of those sums, both modulo the largest prime below 2^16. Cheaper than a CRC and weaker on short inputs, where the first sum never gets near the modulus.

```ts
create("adler32").hash("Wikipedia").digest; // "11e60398"
create("adler32").hash("").digest; // "00000001", the empty input starts at one
```

zlib writes it big-endian after the deflate data, so the last four bytes of a zlib stream are exactly this digest of what it decompresses to.


## Sitemap

See the full [sitemap](https://hashes.agntn.dev/sitemap.md) for all pages.
