| Crates.io | generic_compression |
| lib.rs | generic_compression |
| version | 0.2.0 |
| created_at | 2025-04-27 18:27:47.361816+00 |
| updated_at | 2025-05-06 20:03:43.630513+00 |
| description | A library providing generic implementations of common compression algorithms. |
| homepage | |
| repository | https://github.com/TCA166/compression |
| max_upload_size | |
| id | 1651350 |
| size | 118,082 |
A simple Rust library and repository providing generic implementation of
compression algorithms. Instead of providing end-to-end compression for byte
arrays, this library provides a set of generic algorithms, that encode and
decode data into logical representations of compressed data. So for example, for
the lz77 algorithm, if you provide a byte array, instead of outputting a
compressed byte array, this library outputs a vector of triples.
This means, that this library will not be ideal for the most common use cases, however, if you wish to roll your own compression algorithm, out of prebuilt algorithms this library is perfect for you. It is also a good way to learn about compression algorithms, as the code is simple and easy to read.
lz77: An implementation of the
LZ77 compression
algorithm.lz78: An implementation of the
LZ78 compression
algorithm.lzw: An implementation of the
LZW compression algorithm.MTF: An implementation of the
Move-to-Front
transform.BWT: An implementation of the
Burrows-Wheeler Transform
transform.serde library using the serde feature.This package also provides a command line utility that utilizes the library
to provide a simple interface for compressing and decompressing files using the
lz77, lz78 and lzw algorithms. The command line utility is not the main
feature of this package, but it is a nice addition for testing and playing
around with how parameters affect the compression ratio and speed of the
algorithms.