/lz-str-rs

A port of lz-string to Rust

Primary LanguageRustApache License 2.0Apache-2.0

lz-str-rs

crates.io Documentation MIT/Apache-2 licensed Rust

A port of lz-string to Rust.

Installing

Add the following to your Cargo.toml file:

[dependencies]
lz-str = "0.1.0"

Getting Started

use lz_str::{
    compress,
    decompress,
};

const DATA_STR: &'static str = "The quick brown fox jumps over the lazy dog";

fn main(){
    let compressed = compress(&DATA_STR);
    let decompressed = decompress(&compressed).expect("Valid Decompress");
    assert_eq!(DATA_STR, String::from_utf16(&decompressed).expect("Valid Unicode String"));
}

Testing

cargo test

Benching

cargo bench

Authors

adumbidiot (Nathaniel Daniel)

License

Licensed under either of

at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.