Skip to content

rust-smaz is a pure Rust implementation of smaz - algorithm for compressing very short strings.

License

Notifications You must be signed in to change notification settings

silentsokolov/rust-smaz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-smaz

build Crate Docs

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.

Usage

Add this to your Cargo.toml:

[dependencies]
smaz = "0.1.0"

Quick start

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);
}

About

rust-smaz is a pure Rust implementation of smaz - algorithm for compressing very short strings.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages