Classic lossless compression algorithms in C++17, Go, and Rust.
English | 简体中文 | Documentation
CompressKit is an educational, verification-focused repository for comparing four classic compression algorithms across three implementation languages. It is not a black-box package: the point is to read the implementations, run the same inputs through each language, and verify that compatible formats stay compatible.
| Algorithm | C++17 | Go | Rust | Best fit |
|---|---|---|---|---|
| Huffman Coding | ✓ | ✓ | ✓ | General text/data and prefix-code learning |
| Arithmetic Coding | ✓ | ✓ | ✓ | Entropy-coding concepts and ratio comparison |
| Range Coder | ✓ | ✓ | ✓ | Arithmetic-coder style implementation comparison |
| Run-Length Encoding | ✓ | ✓ | ✓ | Highly repetitive data and simple format study |
All command-line tools use:
<binary> <encode|decode> <input> <output>git clone https://github.com/LessUp/compress-kit.git
cd compress-kit
make build
make testMinimal cross-language check:
printf "Hello CompressKit\n" > input.txt
./algorithms/huffman/cpp/huffman_cpp encode input.txt output.huf
./algorithms/huffman/go/huffman_go decode output.huf restored.txt
diff input.txt restored.txt| Need | Link |
|---|---|
| Full documentation portal | https://lessup.github.io/compress-kit/ |
| Setup and first run | https://lessup.github.io/compress-kit/en/guide/getting-started |
| Algorithm comparison | https://lessup.github.io/compress-kit/en/guide/algorithms |
| API references | https://lessup.github.io/compress-kit/en/api/streaming |
| Cross-language testing | https://lessup.github.io/compress-kit/en/testing/cross-language |
algorithms/ # huffman, arithmetic, range, rle; each has cpp/go/rust
tests/ # generated corpus, streaming contracts, conformance matrix
docs/ # VitePress documentation site
openspec/ # project specifications and archived design changes
| Command | Purpose |
|---|---|
make build |
Build all C++/Go/Rust CLI tools |
make test |
Run unit, streaming, and cross-language conformance tests |
make test-conformance |
Run the executable decode matrix |
make bench |
Run benchmark scripts |
npm run docs:build |
Build the documentation site |
Known limitation: the Range Coder has documented decode performance issues on large files; local conformance and benchmark paths cap Range-heavy sweeps accordingly. See the Range Coder docs before using it for large inputs.
MIT License · Copyright © 2025-2026 LessUp