Edit README.md

This commit is contained in:
2025-09-27 19:12:36 +00:00
parent 20d9865dfa
commit fa7fda5890

View File

@@ -1,15 +1,48 @@
# Œufman # Oeufman: A Huffman Coding Playground
## Run
Install Rust Cargo
```
cargo run
```
## How to use **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?
```
# Use "--" before argument if you run the project with cargo run
--compress , -c <intput> [<output>] To compress a file.
--uncompress, -u <intput> [<output>] To uncompress a file.
--print , -p <input> To print a file compressed.
``` ## 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.
- Its 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
1. Ensure you have [Rust and Cargo](https://www.rust-lang.org/tools/install) installed.
2. Clone this repository or download the source code.
3. 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
```sh
# 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