#zstd #compression-level #api-bindings

sys no-std zstd-sys

Low-level bindings for the zstd compression library

45 stable releases

2.0.15+zstd.1.5.7 Mar 20, 2025
2.0.13+zstd.1.5.6 Aug 2, 2024
2.0.12+zstd.1.5.6 Jul 5, 2024
2.0.10+zstd.1.5.6 Mar 27, 2024
1.1.5-a Mar 24, 2017

#474 in Compression

Download history 1186365/week @ 2025-01-30 1333976/week @ 2025-02-06 1376643/week @ 2025-02-13 1606410/week @ 2025-02-20 1773207/week @ 2025-02-27 2051697/week @ 2025-03-06 1962068/week @ 2025-03-13 2712104/week @ 2025-03-20 1721024/week @ 2025-03-27 1843573/week @ 2025-04-03 1800600/week @ 2025-04-10 1587531/week @ 2025-04-17 1522153/week @ 2025-04-24 1410578/week @ 2025-05-01 1601813/week @ 2025-05-08 1276618/week @ 2025-05-15

6,118,290 downloads per month
Used in 4,406 crates (31 directly)

MIT/Apache

2.5MB
46K SLoC

C 41K SLoC // 0.2% comments Rust 4.5K SLoC // 0.1% comments GNU Style Assembly 390 SLoC // 0.2% comments

Low-level bindings to the zstd library.


zstd-sys

This is the low-level auto-generated binding to the zstd library. You probably don't want to use this library directly; instead, look at zstd-rs or zstd-safe.

Compile it yourself

zstd is included as a submodule. To get everything during your clone, use:

git clone https://github.com/gyscos/zstd-rs --recursive

Or, if you cloned it without the --recursive flag, call this from inside the repository:

git submodule update --init

Then, running cargo build in this directory should take care of building the C library and linking to it.

Build-time bindgen

This library includes a pre-generated bindings.rs file. You can also generate new bindings at build-time, using the bindgen feature:

cargo build --features bindgen

Dependencies

~0–3MB
~43K SLoC