a tool to compress and archive files. i built this to get hands-on with huffman coding and lz77. it's a standalone archiver that handles multi-file structures and verifies data integrity.
you'll need rust and cargo.
cargo run -- compress -i data.txt -a huffman
(swap huffman for lz77 if you want dictionary-based compression)
cargo run -- decompress -i data.crunch -o ./extracted
cargo run -- archive -i src/ -o backup.crunch
cargo run -- list -i backup.crunch
cargo run -- stats -i data.txt
shows a histogram of byte frequencies in the terminal.
cargo run -- bench -i data.txt
compares crunch (huffman) against the standard zip implementation for size and speed.
- huffman: uses canonical huffman to minimize tree overhead in the archive.
- lz77: sliding window implementation with a custom bit-stream format.
- metadata: uses a custom binary header with
crc32checksums for every file. - bit-io: custom bit-level reader and writer for precise stream control.
cargo test