1.8 KiB
1.8 KiB
Oeufman: A Huffman Coding Playground
Oeufman is a Rust implementation of the Huffman coding algorithm, a classic method for lossless data compression. The name is a playful twist on "Huffman" — because why not add a little French flair (and a pun) to your compression tool?
The Joke: "Œufman" vs. "Huffman"
- "Huffman" is the name of the algorithm, named after its creator, David A. Huffman.
- "Œuf" means "egg" in French. So, "Œufman" sounds like "Huffman" but translates to "Eggman" — a silly, egg-themed version of the algorithm.
- It’s a lighthearted nod to the French language and a fun way to make a technical project memorable.
Features
- Compress files using Huffman coding.
- Decompress files back to their original form.
- Print the compressed file structure for debugging or learning.
Installation
- Ensure you have Rust and Cargo installed.
- Clone this repository or download the source code.
- Navigate to the project directory.
Usage
Run the project with cargo run and use the following arguments:
| Argument | Short | Description |
|---|---|---|
--compress |
-c |
Compress a file. Usage: -c <input> [<output>] |
--uncompress |
-u |
Uncompress a file. Usage: -u <input> [<output>] |
--print |
-p |
Print the structure of a compressed file. |
Note: Use -- before arguments if running with cargo run.
Example
# Compress a file
cargo run -- --compress input.txt compressed.oeuf
# Uncompress a file
cargo run -- --uncompress compressed.oeuf output.txt
# Print the structure of a compressed file
cargo run -- --print compressed.oeuf