No description
  • C 63%
  • Rust 32.2%
  • C++ 4.5%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Reynard User a7f1ed3e4e
Some checks failed
CI tests / TestSerde (push) Has been cancelled
CI tests / Test (push) Has been cancelled
CI tests / Test-1 (push) Has been cancelled
CI tests / Test-2 (push) Has been cancelled
CI tests / Test-3 (push) Has been cancelled
CI tests / Test-4 (push) Has been cancelled
CI tests / Test-5 (push) Has been cancelled
CI tests / TestB (push) Has been cancelled
CI tests / WebAssembly (push) Has been cancelled
CI tests / WebAssembly-1 (push) Has been cancelled
Update to Rust 2024 and use vendored dependencies
2026-04-12 18:18:15 +02:00
.github/workflows Update test.yml 2026-01-19 22:01:09 +01:00
benches feat(deflate): evade a bounds check in deflate for a small perf improvement 2024-05-29 02:33:44 +02:00
examples fix(miniz_oxide_core_api): fix include in example1 and example4 2021-11-11 17:48:21 +01:00
fuzz fix(deflate): make more stuff non_exhaustive, reduce deflate stack usage a tiny bit 2026-01-12 22:11:29 +01:00
miniz fix(miniz_oxide_c_api): Add missing funcs, tweak types/functions to make cbindgen work-ish 2021-11-07 01:22:34 +01:00
miniz_oxide Update to Rust 2024 and use vendored dependencies 2026-04-12 18:18:15 +02:00
miniz_oxide_test fix: make compatible with rust 1.56 2025-03-13 17:34:30 +01:00
miniz_stub fix(miniz_oxide_c_api): Add missing funcs, tweak types/functions to make cbindgen work-ish 2021-11-07 01:22:34 +01:00
src fix: handle non_exhaustive tinfl return status in c API 2025-12-11 00:02:21 +01:00
tests Fix clippy lints (#151) 2024-05-17 19:32:56 +02:00
.gitattributes make test data be checked out as binary 2021-11-04 22:32:41 +01:00
.gitignore orginized benches into miniz and oxide mods for benchcmp; bench in travis every time against miniz, not only at PR against prev version 2017-10-02 15:40:59 +03:00
.travis.yml fix(core): Run CI on 1.34 2020-10-04 23:17:13 +02:00
build.sh fix(deflate): further deflate performance improvements especially on fast mode 2025-03-06 23:24:45 +01:00
build_orig_miniz.sh macro for benches; 3 files to bench; simplify features 2017-09-17 23:40:42 +03:00
Cargo.toml Update to Rust 2024 and use vendored dependencies 2026-04-12 18:18:15 +02:00
cbindgen.toml fix(miniz_oxide_c_api): Add missing funcs, tweak types/functions to make cbindgen work-ish 2021-11-07 01:22:34 +01:00
CHANGELOG.md bump version and update changelog 2026-03-13 01:16:49 +01:00
cliff.toml bump version and update changelog 2024-06-18 02:52:26 +02:00
clippy.toml Fix clippy lints (#151) 2024-05-17 19:32:56 +02:00
LICENSE-MIT.md fix(miniz_oxide): add richgel99 (original miniz author) as author and add copyright info from orig miniz in license files 2024-12-21 23:34:36 +01:00
miniz.h fix(miniz_oxide_c_api): Add missing funcs, tweak types/functions to make cbindgen work-ish 2021-11-07 01:22:34 +01:00
miniz_extra_defs.h fix(miniz_oxide_c_api): Add missing funcs, tweak types/functions to make cbindgen work-ish 2021-11-07 01:22:34 +01:00
miniz_zip.h fix(miniz_oxide_c_api): Add missing funcs, tweak types/functions to make cbindgen work-ish 2021-11-07 01:22:34 +01:00
performance.sh Add no_c_export feature to disable no_mangle so we don't need objcopy for benching 2017-10-15 21:13:07 +02:00
README.md Update cbindgen URL (#176) 2025-06-11 20:40:11 +02:00
redefine.txt afl.rs -> cargo-fuzz; fuzzer now compares miniz and miniz_oxide 2017-07-21 16:38:10 +03:00
run_fuzz.sh Make ./test.sh work again 2018-01-26 22:04:59 +01:00
test.sh fix(inflate): don't use bit reverse lookup table when not using alloc and make it smaller 2025-03-05 21:44:54 +01:00
travis-after-success.sh remove miniz_stub dep when not benching or fuzzing; fix bench 2017-10-10 16:24:49 +03:00

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.