https://github.com/gcarq/comprs
Experimental playground for compression algorithms in Rust
https://github.com/gcarq/comprs
algorithms compression-implementations rust
Last synced: 22 days ago
JSON representation
Experimental playground for compression algorithms in Rust
- Host: GitHub
- URL: https://github.com/gcarq/comprs
- Owner: gcarq
- License: bsd-2-clause
- Created: 2018-11-29T23:26:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-29T14:59:30.000Z (almost 2 years ago)
- Last Synced: 2025-04-11T00:45:42.561Z (22 days ago)
- Topics: algorithms, compression-implementations, rust
- Language: Rust
- Homepage:
- Size: 58.6 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# comprs
[](https://travis-ci.org/gcarq/comprs) [](https://coveralls.io/github/gcarq/comprs)
Experimental playground for compression algorithms in Rust.
PPM and Arithmetic coder are inspired by: [Reference-arithmetic-coding](https://github.com/nayuki/Reference-arithmetic-coding).Currently implemented algorithms:
* [Prediction by Partial Matching](https://en.wikipedia.org/wiki/Prediction_by_partial_matching)
* [Arithmetic coding](https://en.wikipedia.org/wiki/Arithmetic_coding)
* [Burrows-Wheeler transform](https://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transform)
* [Move-to-front transform](https://en.wikipedia.org/wiki/Move-to-front_transform)
* [Run-length encoding](https://en.wikipedia.org/wiki/Run-length_encoding)## Usage
```
comprs 0.1.0
Experimental playground for compression algorithms in RustUSAGE:
comprs [FLAGS] [OPTIONS]FLAGS:
-h, --help Prints help information
-n Skip integrity check
-v Sets the level of verbosity
-V, --version Prints version informationOPTIONS:
-o Specify compression level [default: 3] [possible values: 0, 1, 2, 3, 4, 5, 6]ARGS:
mode [possible values: c, d, compress, decompress]
Sets the input file to use
```## Building
```
$ git clone https://github.com/gcarq/comprs.git
$ cd comprs
$ cargo build --release
```## Example
```
$ wget -O world95.txt https://www.gutenberg.org/files/27560/27560.txt
$ ./target/release/comprs c world95.txt
Applying preprocessors ...
-> BWT
-> MTF
Compressing file ...
Compressed Size: 1683194
Compress Ratio: 5.1 (80.57%)
Bits per Byte: 1.5542
Verifying compressed file ...
Decoding preprocessors ...
-> MTF
-> BWT
checksum is OK - 1921997141
```