tetsy-snappy

Crates.iotetsy-snappy
lib.rstetsy-snappy
version0.1.0
sourcesrc
created_at2021-02-17 20:52:46.575305
updated_at2021-02-17 20:52:46.575305
descriptionRust bindings for the snappy compression library
homepage
repositoryhttps://github.com/tetcoin/tetsy-rust-snappy
max_upload_size
id356635
size22,409
Marlon Hanks (marlonhanks)

documentation

README

tetsy-snappy

Build Status

Rust bindings for the snappy compression library.

Currently this library uses snappy v1.1.7. The source for snappy is included in the tetsy-snappy-sys crate, so there's no need to pre-install snappy, and the library will be statically linked.

Example

use tetsy_snappy as snappy;

let input: Vec<u8> = ...;
let compressed = snappy::compress(&input);
let decompressed = snappy::decompress(&compressed);

assert_eq!(decompressed, input);
use tetsy_snappy as snappy;

let input: Vec<u8> = ...;
let mut compressed = Vec::with_capacity(snappy::max_compressed_len(input.len()));
let mut decompressed = Vec::with_capacity(input.len());

let len = snappy::compress_into(&input, &mut compressed);
let _ = snappy::decompress_into(&compressed[..len], &mut decompressed);

assert_eq!(decompressed, input);
Commit count: 46

cargo fmt