dclamage / lz-str-rs

A port of lz-string to Rust

Home Page:https://adumbidiot.github.io/lz-str-rs/lz_str/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

A port of lz-string to Rust

https://adumbidiot.github.io/lz-str-rs/lz_str/

License:Apache License 2.0


Languages

Language:Rust 95.1%Language:JavaScript 4.8%Language:Batchfile 0.1%