bpack

Crates.iobpack
lib.rsbpack
version0.1.1
sourcesrc
created_at2020-11-15 06:36:47.221224
updated_at2020-11-15 07:06:02.964828
descriptionFast, simple and easy to use data compression library meant to work with byte slices of String and str types.
homepage
repositoryhttps://github.com/exellife/bpack
max_upload_size
id312502
size51,790
(exellife)

documentation

README

BPack

A Rust library for compressing byte slices of String and str types.

bpack is a lossless compression library that is meant to reduce size of data (up to 65535 bytes) containing 95 ascii characters ranging from 32 to 126 (inclusive). In another words it is meant to work with byte slices of the String and/or str types. It compresses 65535 bytes in about 12ms and decompresses back in about 57ms on Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz. Makes sense to use this library if data size is in range from ~2000 to 65535 bytes.

Usage

Cargo.toml

[dependencies]
bpack = "0.1.0"
use bpack::{pack, unpack};

fn main() {
    let data = "some very long string".as_bytes();

    if let Some(packed) = pack(data) {
        let unpacked = unpack(packed);
        assert_eq!(data, unpacked.as_slice());
    }
}

Commit count: 9

cargo fmt