Skip to content
ZLIB × LEAN / ALGORITHM DETAIL & VERIFICATION

Checksums and composition

Check data across batches and retain the information needed to combine sequences.

THE JOB OF THIS COMPONENT

Zlib and gzip wrappers store a checksum of the uncompressed data. Recomputing and comparing it during decoding helps detect damage. Adler and CRC accumulate this information in a small state and continue across buffers.

Locate this topic on the global map ↗

The first 2 chapters explain algorithms, data layouts, and optimizations. The final chapter connects the proof argument. Read in order or enter from a familiar stage.

  1. 01
    IMPLEMENTATION DETAIL

    Adler-32 recurrence and batching

    Check a byte sequence with two running sums, then understand batching and combination.

    ↗
  2. 02
    IMPLEMENTATION DETAIL

    CRC-32 bits and table lookup

    Understand CRC one bit at a time, then see how tables reduce repeated work.

    ↗
  3. 03
    PROOF ARGUMENT

    The checksum proof argument

    Explain why optimized implementations compute the same checksum and read only admitted input.

    ↗
ZLIB × LEAN

Global contents

READING NOWChecksums and composition