Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gendx/lzma-rs
An LZMA decoder written in pure Rust
https://github.com/gendx/lzma-rs
codec decoder lzma
Last synced: about 2 months ago
JSON representation
An LZMA decoder written in pure Rust
- Host: GitHub
- URL: https://github.com/gendx/lzma-rs
- Owner: gendx
- License: mit
- Created: 2017-10-04T09:35:15.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-17T10:20:01.000Z (2 months ago)
- Last Synced: 2024-07-26T23:49:36.536Z (about 2 months ago)
- Topics: codec, decoder, lzma
- Language: Rust
- Homepage:
- Size: 1.73 MB
- Stars: 126
- Watchers: 4
- Forks: 27
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - gendx/lzma-rs - An LZMA decoder written in pure Rust (Rust)
README
# lzma-rs
[![Crate](https://img.shields.io/crates/v/lzma-rs.svg?logo=rust)](https://crates.io/crates/lzma-rs)
[![Documentation](https://img.shields.io/docsrs/lzma-rs?logo=rust)](https://docs.rs/lzma-rs)
[![Minimum Rust 1.71](https://img.shields.io/badge/rust-1.71%2B-orange.svg?logo=rust)](https://releases.rs/docs/1.71.0/)
[![Dependencies](https://deps.rs/repo/github/gendx/lzma-rs/status.svg)](https://deps.rs/repo/github/gendx/lzma-rs)
[![Safety Dance](https://img.shields.io/badge/unsafe-forbidden-success.svg?logo=rust)](https://github.com/rust-secure-code/safety-dance/)
![Build Status](https://github.com/gendx/lzma-rs/workflows/Build%20and%20run%20tests/badge.svg)
[![Codecov](https://codecov.io/gh/gendx/lzma-rs/branch/master/graph/badge.svg?token=HVo74E0wzh)](https://codecov.io/gh/gendx/lzma-rs)
[![Lines of Code](https://www.aschey.tech/tokei/github/gendx/lzma-rs?category=code)](https://github.com/aschey/vercel-tokei)
[![Downloads (crates.io)](https://img.shields.io/crates/d/lzma-rs?label=downloads&logo=rust)](https://crates.io/crates/lzma-rs)This project is a decoder for LZMA and its variants written in pure Rust, with focus on clarity.
It already supports LZMA, LZMA2 and a subset of the `.xz` file format.## Usage
Decompress a `.xz` file.
```rust
let filename = "foo.xz";
let mut f = std::io::BufReader::new(std::fs::File::open(filename).unwrap());
// "decomp" can be anything that implements "std::io::Write"
let mut decomp: Vec = Vec::new();
lzma_rs::xz_decompress(&mut f, &mut decomp).unwrap();
// Decompressed content is now in "decomp"
```## Encoder
For now, there is also a dumb encoder that only uses byte literals, with many hard-coded constants for code simplicity.
Better encoders are welcome!## Contributing
Pull-requests are welcome, to improve the decoder, add better encoders, or more tests.
Ultimately, this project should also implement .xz and .7z files.## License
MIT