#zlib #deflate #encoding #miniz

miniz_oxide

DEFLATE compression and decompression library rewritten in Rust based on miniz

5 releases

0.2.0 Oct 16, 2018
0.1.3 Jun 23, 2018
0.1.2 Jan 9, 2018
0.1.1 Oct 28, 2017
0.1.0 Oct 10, 2017

#3 in Compression

Download history 3852/week @ 2018-10-11 6570/week @ 2018-10-18 7828/week @ 2018-10-25 8659/week @ 2018-11-01 8983/week @ 2018-11-08 10294/week @ 2018-11-15 9424/week @ 2018-11-22 8807/week @ 2018-11-29 10214/week @ 2018-12-06 14885/week @ 2018-12-13 17165/week @ 2018-12-20 12048/week @ 2018-12-27 9762/week @ 2019-01-03

44,675 downloads per month
Used in 301 crates (3 directly)

MIT license

172KB
3.5K 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