Skip to content

meerhwebdev/file_compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 Huff — Huffman Compression CLI (Rust)

huff is a fast, lightweight, and fully standalone Huffman-based file compressor written in Rust.
It supports:

  • ✔️ Compressing .txt files into a custom .huff binary format
  • ✔️ Decompressing .huff files back to original text
  • ✔️ Optional parallel frequency counting with Rayon
  • ✔️ Clean CLI interface using Clap
  • ✔️ Extremely fast & memory-safe

This tool is ideal for learning compression algorithms, benchmarking performance, and experimenting with bit-level control.


🚀 Features

  • ⚡ High-performance Huffman coding
  • 🧠 Custom binary format using bit-level encoding
  • 🧵 Parallel processing support
  • 🔧 Clean and readable CLI with help + flags
  • 📦 Cross-platform (Linux, macOS, Windows)

🧩 Project Structure

src/
 ├── main.rs       # CLI logic (Clap)
 ├── huffman.rs    # Huffman encoding/decoding core
 ├── compression.rs    # Reading text file -> .huff file logic
Cargo.toml
README.md

🛠️ Installation

Linux / macOS

Build:

cargo build --release
sudo cp target/release/huff /usr/local/bin/

🛠️ Installation

Windows

Build:

cargo build --release
copy target\release\huff.exe C:\Windows\System32\

📘 Usage

Help

huff --help

Compress a file

huff compress -i input.txt -o output.huff

Decompress a file

huff decompress -i output.huff -o recovered.txt

📄 Example

Compress

huff compress -i quotes.txt -o quotes.huff

Decompress

huff decompress -i quotes.huff -o quotes_restored.txt

About

Simple huffman file compressor/decompressor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages