#zlib #deflate #encoding #miniz

miniz_oxide

DEFLATE compression and decompression library rewritten in Rust based on miniz

11 releases

✓ Uses Rust 2018 edition

0.3.2 Aug 11, 2019
0.3.0 Jul 22, 2019
0.2.1 Jan 23, 2019
0.2.0 Oct 16, 2018
0.1.1 Oct 28, 2017

#8 in Compression

Download history 33065/week @ 2019-04-28 29152/week @ 2019-05-05 35488/week @ 2019-05-12 39723/week @ 2019-05-19 42601/week @ 2019-05-26 42182/week @ 2019-06-02 41727/week @ 2019-06-09 39286/week @ 2019-06-16 40914/week @ 2019-06-23 44276/week @ 2019-06-30 40935/week @ 2019-07-07 41497/week @ 2019-07-14 50657/week @ 2019-07-21 47889/week @ 2019-07-28 51510/week @ 2019-08-04

185,054 downloads per month
Used in 1,188 crates (7 directly)

MIT license

190KB
4K SLoC

miniz_oxide

A pure rust replacement for the miniz DEFLATE/zlib encoder/decoder. The plan for this crate is to be used as a back-end for the flate2 crate and eventually remove the need to depend on a C library.

Usage

Simple compression/decompression:


extern crate miniz_oxide;

use miniz_oxide::inflate::decompress_to_vec;
use miniz_oxide::deflate::compress_to_vec;

fn roundtrip(data: &[u8]) {
    let compressed = compress_to_vec(data, 6);
    let decompressed = decompress_to_vec(decompressed.as_slice()).expect("Failed to decompress!");
}

TODO: Advanced functions.


lib.rs:

A pure rust replacement for the miniz DEFLATE/zlib encoder/decoder. The plan for this crate is to be used as a back-end for the flate2 crate and eventually remove the need to depend on a C library.

Usage

Simple compression/decompression:


use miniz_oxide::inflate::decompress_to_vec;
use miniz_oxide::deflate::compress_to_vec;

fn roundtrip(data: &[u8]) {
    let compressed = compress_to_vec(data, 6);
    let decompressed = decompress_to_vec(compressed.as_slice()).expect("Failed to decompress!");
#   let _ = decompressed;
}

# roundtrip(b"Test_data test data lalalal blabla");

Dependencies