smaz 0.1.0

Smaz is a simple compression library suitable for compressing very short strings.
Documentation
  • Coverage
  • 100%
    6 out of 6 items documented3 out of 4 items with examples
  • Size
  • Source code size: 13.04 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.48 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • silentsokolov/rust-smaz
    6 3 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • silentsokolov

rust-smaz

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