| Crates.io | huffc |
| lib.rs | huffc |
| version | 0.1.1 |
| created_at | 2025-03-01 16:39:22.742396+00 |
| updated_at | 2025-03-01 22:54:17.250692+00 |
| description | A CLI tool for Huffman compression and decompression |
| homepage | |
| repository | https://github.com/bwintertkb/huffman_compression |
| max_upload_size | |
| id | 1573859 |
| size | 57,320 |
huffc is a CLI tool for compressing and decompressing files using Huffman encoding. It supports both file-based and standard input compression, allowing users to efficiently encode and decode data.
You can install huffc using Cargo:
cargo install huffc
huffc provides options for both compression and decompression. You must specify either --compress or --decompress, but not both.
To compress a file and save the output:
huffc --compress -i input.txt -o compressed.huff
To decompress a .huff file back to its original form:
huffc --decompress -i compressed.huff -o output.txt
You can also use standard input for compression or decompression:
echo "Hello, Huffman!" | huffc --compress -o output.huff
cat output.huff | huffc --decompress -o output.txt
| Flag | Description |
|---|---|
-c, --compress |
Compress a file or standard input |
-d, --decompress |
Decompress a file or standard input |
-i, --input <FILE> |
Specify the input file (optional for stdin) |
-o, --out-file <FILE> |
Specify the output file (required for stdin) |
huffc provides meaningful error messages when incorrect arguments are used:
Error: You must specify either --compress or --decompress, but not both.No file path provided. Use --help for more information.File does not exist in path provided.File does not have the file extension '.huff' (for decompression)No outfile path provided. (when using standard input)This project is licensed under the MIT License.