#api-bindings #encoding #bzip

bzip2

Bindings to libbzip2 for bzip2 compression and decompression exposed as Reader/Writer streams

22 releases

new 0.5.1 Feb 11, 2025
0.5.0 Dec 11, 2024
0.4.4 Jan 5, 2023
0.4.3 Jun 9, 2021
0.0.3 Nov 19, 2014

#11 in Compression

Download history 499242/week @ 2024-10-22 483803/week @ 2024-10-29 474876/week @ 2024-11-05 503866/week @ 2024-11-12 480856/week @ 2024-11-19 371329/week @ 2024-11-26 483474/week @ 2024-12-03 534868/week @ 2024-12-10 435601/week @ 2024-12-17 249927/week @ 2024-12-24 350440/week @ 2024-12-31 585805/week @ 2025-01-07 558967/week @ 2025-01-14 555606/week @ 2025-01-21 573885/week @ 2025-01-28 513837/week @ 2025-02-04

2,305,733 downloads per month
Used in 2,219 crates (232 directly)

MIT/Apache

680KB
6.5K SLoC

C 5K SLoC // 0.2% comments Rust 1K SLoC // 0.0% comments XSL 278 SLoC // 0.1% comments Shell 72 SLoC // 0.3% comments Perl 38 SLoC // 0.4% comments

bzip2

Documentation

A streaming compression/decompression library for rust with bindings to libbz2.

Features

By default, bzip2-rs attempts to use the system libbz2. When libbz2 is not available, the library is built from source. A from source build requires a functional C toolchain for your target, and may not work for all targets (in particular webassembly).

libbz2-rs-sys

Since version 0.5.0, this crate also supports using libbz2-rs-sys, a drop-in compatible rust implementation of libbz2. With this feature enabled, cross-compilation should work like any other rust code, and no C toolchain is needed to compile this crate or its dependencies.

bzip2 = { version = "0.5.1", default-features = false, features = ["libbz2-rs-sys"] }

static

Always build libbz2 from C source, and statically link it. This flag is only meaningful when bzip2-sys is used, and has no effect when libbz2-rs-sys is used as the bzip2 implementation.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this repository by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies