Crates.io | smaz |
lib.rs | smaz |
version | 0.1.0 |
source | src |
created_at | 2019-01-02 13:21:21.874384 |
updated_at | 2019-01-02 13:21:21.874384 |
description | Smaz is a simple compression library suitable for compressing very short strings. |
homepage | https://github.com/silentsokolov/rust-smaz |
repository | https://github.com/silentsokolov/rust-smaz |
max_upload_size | |
id | 105010 |
size | 13,187 |
rust-smaz is a pure Rust implementation of smaz - algorithm for compressing very short strings. See original C implementation smaz by antirez for information on smaz and the algorithm itself.
Add this to your Cargo.toml
:
[dependencies]
smaz = "0.1.0"
extern crate smaz;
use smaz::{compress,decompress};
fn main() {
let s = "string";
let compressed = compress(&s.as_bytes());
println!("compress bytes: {:?}", &compressed);
let decompressed = decompress(&compressed).unwrap();
let origin = str::from_utf8(&decompressed).unwrap();
assert_eq!(s, origin);
}