An open API service indexing awesome lists of open source software.

https://github.com/teschmitt/bzippr

A Rust implementation of the bzip2 compression algorithm.
https://github.com/teschmitt/bzippr

bzip2 compression crate rust

Last synced: 5 months ago
JSON representation

A Rust implementation of the bzip2 compression algorithm.

Awesome Lists containing this project

README

          

# bzippr

A Rust implementation of the `bzip2` compression algorithm.

## Overview

bzippr is a command-line tool that implements the `bzip2` compression algorithm from scratch. The project aims to provide a comprehensive Rust implementation of all stages in the bzip2 compression pipeline.

## Features

- ✅ Run-Length Encoding (RLE) compression and decompression
- ✅ Burrows-Wheeler Transform (BWT) implementation
- ✅ Move-to-Front (MTF) transformation (with second RLE pass)
- ⏳ Huffman Coding
- ⏳ Full bzip2 format support
- ⏳ Command-line interface for file compression

## Implementation Status

The project has successfully implemented the following compression stages:

1. **Run-Length Encoding (RLE)**: A lossless data compression technique that encodes consecutive repeated data elements.
2. **Burrows-Wheeler Transform (BWT)**: A reversible transformation that rearranges input data to improve compressibility.
3. **Move-to-Front Transform (MTF)** (includes second RLE pass): An algorithm that reorders data based on recency of occurrence, improving compression for certain types of data.

## Installation

```bash
cargo build --release
```

## Usage

The command-line interface is still in development. The core compression algorithms can be used as a library.

```rust
use bzippr::{bwt, mtf, rle};

// Example usage will be provided once CLI is complete
```

## Future Work

- Implement Huffman Coding stage
- Integrate all compression stages into the full bzip2 pipeline
- Develop a user-friendly command-line interface
- Add benchmarking against the original bzip2 implementation
- Support for additional bzip2 features (block sizes, compression levels)

## License

Gnu AGPLv3 (see LICENSE file for full terms)

## Contributing

This project is in active development. Feel free to contribute by opening issues or submitting pull requests.