Frommi/miniz_oxide

Rust replacement for miniz

C

257

532 commits

updated Oct 11, 2026

See the code

README

Main library Crates.ioDocs

C API Crates.ioDocs

miniz_oxide

Pure rust replacement for the miniz deflate/zlib encoder/decoder using no unsafe code. Builds in no_std mode, though requires the use of alloc and collections crates or preallocated memory slices.

This project is organized into a C API shell and a rust crate. The Rust crate is found in the miniz_oxide subdirectory. See the subdirectory for the full README.

For a friendlier streaming API using readers and writers, flate2 can be used, which can use miniz_oxide as a rust-only back-end.

IMPORTANT! Versions prior to 0.8.4 have a massive regression in compression performance in versions of rust 1.81 and newer due to a upstream regression. If miniz_oxide is part of your dependencies, please update to the latest version to avoid performance regressions!

miniz_oxide_C_API

The C API is intended to replicate the API exported from miniz, and in turn also part of zlib. The C header is generated using cbindgen. The current implementation has not seen a lot of testing outside of automated tests, is a bit weak in documentation and should be seen as experimental.

The data structures do not share the exact same layout that is specified in miniz.h (from the original miniz), and should thus be allocated via the included functions.

API documentation

TODO

Testing

$ cargo test
$ ./test.sh

Including in C/C++ projects

Link against the libminiz_oxide_c_api.a generated by build.sh. The generated header that can be used is miniz.h (using the original miniz headers may or may not work), which currently also uses miniz_extra_defs.h for some static definitions.

Cargo-fuzz testing

Install fuzzer:

$ cargo install cargo-fuzz

Currently the inflate_nonwrapping and roundtrip_target fuzz targets work

$ cargo +nightly fuzz run inflate_nonwrapping

License

This library (excluding the original miniz C code used for tests) is dual licensed under the MIT license and Apache 2.0 license. The library is based on the miniz C library by Rich Geldreich which is released under the MIT license.

Frommi/miniz_oxide

Rust replacement for miniz

C

257

532 commits

updated Oct 11, 2026

See the code

README

Main library Crates.ioDocs

C API Crates.ioDocs

miniz_oxide

Pure rust replacement for the miniz deflate/zlib encoder/decoder using no unsafe code. Builds in no_std mode, though requires the use of alloc and collections crates or preallocated memory slices.

This project is organized into a C API shell and a rust crate. The Rust crate is found in the miniz_oxide subdirectory. See the subdirectory for the full README.

For a friendlier streaming API using readers and writers, flate2 can be used, which can use miniz_oxide as a rust-only back-end.

IMPORTANT! Versions prior to 0.8.4 have a massive regression in compression performance in versions of rust 1.81 and newer due to a upstream regression. If miniz_oxide is part of your dependencies, please update to the latest version to avoid performance regressions!

miniz_oxide_C_API

The C API is intended to replicate the API exported from miniz, and in turn also part of zlib. The C header is generated using cbindgen. The current implementation has not seen a lot of testing outside of automated tests, is a bit weak in documentation and should be seen as experimental.

The data structures do not share the exact same layout that is specified in miniz.h (from the original miniz), and should thus be allocated via the included functions.

API documentation

TODO

Testing

$ cargo test
$ ./test.sh

Including in C/C++ projects

Link against the libminiz_oxide_c_api.a generated by build.sh. The generated header that can be used is miniz.h (using the original miniz headers may or may not work), which currently also uses miniz_extra_defs.h for some static definitions.

Cargo-fuzz testing

Install fuzzer:

$ cargo install cargo-fuzz

Currently the inflate_nonwrapping and roundtrip_target fuzz targets work

$ cargo +nightly fuzz run inflate_nonwrapping

License

This library (excluding the original miniz C code used for tests) is dual licensed under the MIT license and Apache 2.0 license. The library is based on the miniz C library by Rich Geldreich which is released under the MIT license.

Project health

Overall

4.7/10

Maintained

9/10

Code review

3/10
OpenSSF Scorecard

crates.io

Latest release

0.9.1 · Mar 13, 2026

Releases this year

2

Significant stargazers

Martin Liška

162 followers · starred Sep 2024

yjh

139 followers · starred Jun 2022

Na'aman Hirschfeld

530 followers · starred Jul 2026

Seiya Nuta

902 followers · starred Feb 2021