4 releases

Uses old Rust 2015

0.1.2 Dec 11, 2018
0.1.1 Sep 3, 2018
0.1.0 Aug 30, 2018
0.1.0-beta.0 Aug 29, 2018

#23 in #snappy

Download history 99/week @ 2024-07-29 91/week @ 2024-08-05 117/week @ 2024-08-12 106/week @ 2024-08-19 88/week @ 2024-08-26 75/week @ 2024-09-02 63/week @ 2024-09-09 91/week @ 2024-09-16 101/week @ 2024-09-23 87/week @ 2024-09-30 54/week @ 2024-10-07 223/week @ 2024-10-14 161/week @ 2024-10-21 62/week @ 2024-10-28 54/week @ 2024-11-04 32/week @ 2024-11-11

345 downloads per month
Used in 4 crates (2 directly)

GPL-3.0 license

1MB
2.5K SLoC

C++ 2.5K SLoC // 0.2% comments Rust 61 SLoC // 0.2% comments

parity-snappy

Build Status 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 parity-snappy-sys crate, so there's no need to pre-install snappy, and the library will be statically linked.

Example

use parity_snappy as snappy;

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

assert_eq!(decompressed, input);
use parity_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);

lib.rs:

Snappy compression bindings.

Dependencies