Skip to content

Commit

Permalink
fix(docs): update miniz_oxide readme a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindln committed Feb 21, 2025
1 parent 341edf5 commit 743ae50
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions miniz_oxide/Readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# miniz_oxide

A fully safe, pure rust replacement for the [miniz](https://github.com/richgel999/miniz) DEFLATE/zlib encoder/decoder.
The main intention of this crate is to be used as a back-end for the [flate2](https://github.com/alexcrichton/flate2-rs), but it can also be used on its own. Using flate2 with the ```rust_backend``` feature provides an easy to use streaming API for miniz_oxide.
A fully safe, pure rust port and replacement for the [miniz](https://github.com/richgel999/miniz) DEFLATE/zlib encoder/decoder originally written by Rich Geldreich. The main intention of this crate is to be used as a back-end for the [flate2](https://github.com/rust-lang/flate2-rs), but it can also be used on its own. Using flate2 with the default ```rust_backend``` feature provides an easy to use streaming API for miniz_oxide.

The library is fully [no_std](https://docs.rust-embedded.org/book/intro/no-std.html). By default, the `with-alloc` feature is enabled, which requires the use of the `alloc` and `collection` crates as it allocates memory.

Expand All @@ -14,11 +13,11 @@ Running without allocation reduces crate functionality:
- The `deflate` module is removed completely
- Some `inflate` functions which return a `Vec` are removed

miniz_oxide 0.5.x and 0.6.x Requires at least rust 1.40.0 0.3.x requires at least rust 0.36.0.
miniz_oxide 0.8.x currently requires at least Rust 1.56.0, though to leave some room for future internal improvements the minimum version might be raised in the future though it never be made incompatible with anything more recent than the last 4 rust versions and in all likelyhood not require anything even remotely that recent unless there is a very good reason for it.

miniz_oxide features no use of unsafe code.

miniz_oxide can optionally be made to use a simd-accelerated version of adler32 via the [simd-adler32](https://crates.io/crates/simd-adler32) crate by enabling the 'simd' feature. This is not enabled by default as due to the use of simd intrinsics, the simd-adler32 has to use unsafe. The default setup uses the [adler](https://crates.io/crates/adler) crate which features no unsafe code.
miniz_oxide can optionally be made to use a simd-accelerated version of adler32 via the [simd-adler32](https://crates.io/crates/simd-adler32) crate by enabling the 'simd' feature. This is not enabled by default as due to the use of simd intrinsics, the simd-adler32 has to use unsafe. The default setup uses the [adler2](https://crates.io/crates/adler2) crate which features no unsafe code. (a fork of the [adler](https://github.com/jonas-schievink/adler) crate as that crate is archived and no longer maintained.)

## Usage
Simple compression/decompression:
Expand All @@ -41,4 +40,4 @@ fn main() {
}

```
These simple functions will do everything in one go and are thus not recommended for use cases outside of prototyping/testing as real world data can have any size and thus result in very large memory allocations for the output Vector. Consider using miniz_oxide via [flate2](https://github.com/alexcrichton/flate2-rs) which makes it easy to do streaming (de)compression or the low-level streaming functions instead.
These simple functions will do everything in one go and are thus not recommended for use cases outside of prototyping/testing as real world data can have any size and thus result in very large memory allocations for the output Vector. Consider using miniz_oxide via [flate2](https://github.com/rust-lang/flate2-rs) which makes it easy to do streaming (de)compression or the low-level streaming functions instead.

0 comments on commit 743ae50

Please sign in to comment.