| 1 |  |
| 2 | [](https://codecov.io/gh/trifectatechfoundation/libbzip2-rs) |
| 3 | [](https://crates.io/crates/libbz2-rs-sys) |
| 4 | |
| 5 | |
| 6 | # libbzip2-rs: a safer libbzip |
| 7 | |
| 8 | This repository contains a Rust implementation of the bzip2 file format that is compatible with the libbzip2 API. |
| 9 | |
| 10 | This repository contains the following public crate: |
| 11 | |
| 12 | * [libbz2-rs-sys](https://crates.io/crates/libbz2-rs-sys/), a libbzip2-compatible C API. |
| 13 | |
| 14 | ## How to use libbzip2-rs in your project |
| 15 | |
| 16 | libbzip2-rs can be used in both Rust and C projects. |
| 17 | |
| 18 | ### Rust projects |
| 19 | |
| 20 | By far the easiest way to use libbzip2-rs is through the [bzip2](https://crates.io/crates/bzip2) crate which uses the `libbz2-rs-sys` backend by default. |
| 21 | |
| 22 | You can also directly use the C api exported by the `libbz2-rs-sys` crate. |
| 23 | |
| 24 | ## C projects |
| 25 | |
| 26 | libbzip2-rs can be built as a shared object file for usage by C programs that dynamically link to libbzip2. Please see the example in [libbz2-rs-sys-cdylib](https://github.com/trifectatechfoundation/libbzip2-rs/tree/main/libbz2-rs-sys-cdylib). |
| 27 | |
| 28 | ## Acknowledgment |
| 29 | |
| 30 | This project is based on a [c2rust](https://github.com/immunant/c2rust) translation of the original [libbzip2](https://sourceware.org/bzip2/). |
| 31 | |
| 32 | ## About |
| 33 | |
| 34 | libbzip2-rs is part of Trifecta Tech Foundation's [Data compression initiative](https://trifectatech.org/initiatives/data-compression/). |
| 35 | |
| 36 | ## Funding |
| 37 | |
| 38 | This project is funded through [NGI Zero Core](https://nlnet.nl/core), a fund established by [NLnet](https://nlnet.nl) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu) program. Learn more at the [NLnet project page](https://nlnet.nl/project/ZipLinting). |
| 39 | |
| 40 | [<img src="https://nlnet.nl/logo/banner.png" alt="NLnet foundation logo" width="20%" />](https://nlnet.nl) |
| 41 | [<img src="https://nlnet.nl/image/logos/NGI0_tag.svg" alt="NGI Zero Logo" width="20%" />](https://nlnet.nl/core) |