gzip-zero 0.1.1

A no-std, allocation-free streaming gzip decoder
Documentation
  • Coverage
  • 19.51%
    8 out of 41 items documented0 out of 10 items with examples
  • Size
  • Source code size: 65.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 271.2 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • no-std-rs/oci-zero
    1 2 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • pawelchcki

gzip-zero

crates.io docs.rs

gzip-zero is a no_std, allocation-free streaming gzip decoder. It wraps the allocation-free core of miniz_oxide with incremental gzip header, trailer, checksum, size, and concatenated-member handling.

The caller supplies the 32 KiB DEFLATE history buffer. Input may be split at arbitrary byte boundaries and decoded output is returned as borrowed slices.

The crate requires Rust 1.75 or newer and contains no unsafe code (#![forbid(unsafe_code)]).

[dependencies]
gzip-zero = "0.1"

The crate is no_std with an empty default feature set, so no default-features opt-out is needed.

Testing

The test suite uses upstream zlib as a test-only oracle. Its deterministic differential test generates 256 gzip members across eight payload families; sizes through 1 MiB around powers of two, the 32 KiB history window, and the 65,535-byte stored-block limit; compression levels 0-9; DEFLATE windows 9-15; stored, fixed, and dynamic block opportunities; optional header fields; flush schedules; and streaming fragmentation. It also checks a 48-member concatenated stream. Increase or reduce the generated case count with GZIP_ZERO_CROSSCHECK_CASES:

GZIP_ZERO_CROSSCHECK_CASES=1024 cargo test -p gzip-zero --test differential

That corpus is derived from a fixed base seed, so every push replays the same 256 cases. A nightly workflow runs a much larger corpus from a changing seed and prints the seed it used; GZIP_ZERO_CROSSCHECK_SEED reproduces such a run exactly:

GZIP_ZERO_CROSSCHECK_CASES=25000 GZIP_ZERO_CROSSCHECK_SEED=<seed> \
  cargo test -p gzip-zero --release --test differential

Licensed under either Apache-2.0 or MIT, at your option.