#zlib #miniz #deflate #encoding

miniz_oxide

DEFLATE compression and decompression library rewritten in Rust based on miniz

4 releases

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

#7 in Compression

Download history 2906/week @ 2018-05-06 3603/week @ 2018-05-13 3111/week @ 2018-05-20 2734/week @ 2018-05-27 3626/week @ 2018-06-03 3381/week @ 2018-06-10 2926/week @ 2018-06-17 3300/week @ 2018-06-24 4026/week @ 2018-07-01 3714/week @ 2018-07-08 3539/week @ 2018-07-15 2734/week @ 2018-07-22 2534/week @ 2018-07-29

11,254 downloads per month

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");

MIT license

Dependencies

Reverse deps