lz4-compression 0.6.1

Pure Rust implementation of LZ4 compression and decompression as a library

Crate Documentation


Pure rust implementation of lz4 compression and decompression.

This is based on redox-os' lz4 compression, but has been reworked to be actually usable as a library crate.

(The redox-os lz4 crate does not re-export the error types and does not merge pull requests)


use lz4_compression::prelude::{ decompress, compress };

fn main(){
    let uncompressed_data: &[u8] = b"Hello world, what's up?";

    let compressed_data = compress(uncompressed_data);
    let decompressed_data = decompress(&compressed_data).unwrap();

    assert_eq!(uncompressed_data, decompressed_data.as_slice());