4个版本

使用旧的Rust 2015

0.1.2 2018年12月11日
0.1.1 2018年9月3日
0.1.0 2018年8月30日
0.1.0-beta.02018年8月29日

20 in #snappy

Download history 121/week @ 2023-12-18 68/week @ 2023-12-25 58/week @ 2024-01-01 130/week @ 2024-01-08 92/week @ 2024-01-15 78/week @ 2024-01-22 65/week @ 2024-01-29 67/week @ 2024-02-05 87/week @ 2024-02-12 78/week @ 2024-02-19 129/week @ 2024-02-26 128/week @ 2024-03-04 97/week @ 2024-03-11 131/week @ 2024-03-18 118/week @ 2024-03-25 204/week @ 2024-04-01

572 monthly downloads
用于 4 个crate(直接使用2个)

GPL-3.0 许可

1MB
2.5K SLoC

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

parity-snappy

Build Status Build status

Rust绑定snappy压缩库。

目前该库使用snappy v1.1.7。snappy的源代码包含在parity-snappy-sys crate中,因此无需预先安装snappy,库将进行静态链接。

示例

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压缩绑定。

依赖项