#lzf #headers #compression

lzf_headers

A small wrapper library for handling LZF compression with headers

2 releases

Uses old Rust 2015

0.1.1 Mar 20, 2018
0.1.0 Mar 18, 2018

#172 in Compression

MIT license

8KB
146 lines

lzf_headers

A thin wrapper that can compress/decompress LZF payloads, with LZF, headers for Rust

Note: If your payload does not have or does not need the headers, feel free to use the lzf library by Jan-Erik Rediger.

Usage

First, import the package. In Cargo.toml:

[dependencies]
lzf = "0.1.1"

Then, use the compress and decompress functions (that's the whole API, basically)

let test_string = "An adequately long string. Longer than this..."
match compress_lzf(test_string.as_bytes()) {
    Ok(decompressed) => // Handle decompressed data,
    Err(error) => // Handle error
};
let compressed_content = ...
match decompress_lzf(compressed_content) {
    Ok(decompressed) => println!("Decompressed: {:?}", decompressed),
    Err(error) => // Handle error
};

Notes

Please let me know if you need more information, documentation, or if you found a bug.

Or, file a Pull Request, of course. ;)

Dependencies

~1.5MB

UZ