3636
3737---
3838
39+ ## 📋 Prerequisites
40+
41+ | Language | Minimum Version | Installation |
42+ | ----------| -----------------| --------------|
43+ | C++ | GCC 9+ / Clang 10+ | ` apt install g++ ` or ` brew install gcc ` |
44+ | Go | 1.21+ | [ golang.org/dl] ( https://golang.org/dl ) |
45+ | Rust | 1.70+ | [ rustup.rs] ( https://rustup.rs ) |
46+ | Python | 3.8+ | Only needed for generating test data |
47+
48+ Verify environment:
49+ ``` bash
50+ g++ --version # Must support -std=c++17
51+ go version
52+ rustc --version
53+ ```
54+
55+ ---
56+
3957## ✨ Features
4058
4159- 🔤 ** Multi-Language** — Identical implementations in C++17, Go 1.21+, and Rust 1.70+
@@ -72,10 +90,34 @@ Is your data highly repetitive?
7290``` bash
7391git clone https://github.com/LessUp/encoding.git
7492cd encoding
75- make build && make test
93+
94+ # 1. Build all implementations
95+ make build
96+
97+ # 2. Generate test data (requires Python 3.8+)
98+ make test-data
99+
100+ # 3. Run tests
101+ make test
102+ ```
103+
104+ ### Quick Verification
105+
106+ ``` bash
107+ # Create a test file
108+ echo " Hello, World! Hello, World!" > input.txt
109+
110+ # Encode with C++
111+ ./algorithms/huffman/cpp/huffman_cpp encode input.txt output.huf
112+
113+ # Decode with Go
114+ ./algorithms/huffman/go/huffman_go decode output.huf restored.txt
115+
116+ # Verify
117+ diff input.txt restored.txt && echo " ✓ Cross-language verification passed"
76118```
77119
78- ### Cross-Language Verification
120+ ### Cross-Language Verification (Alternative)
79121
80122``` bash
81123# Encode with C++
@@ -116,15 +158,44 @@ encoding/
116158| ` make bench ` | Run benchmarks |
117159| ` make clean ` | Remove build artifacts |
118160
119- ## Go Library Usage
161+ ## 💻 Usage
162+
163+ All implementations follow the unified CLI interface:
164+
165+ ``` bash
166+ < binary> < encode| decode> < input> < output>
167+ ```
168+
169+ ### CLI Examples
170+
171+ ``` bash
172+ # Huffman - C++
173+ ./algorithms/huffman/cpp/huffman_cpp encode input.txt output.huf
174+ ./algorithms/huffman/cpp/huffman_cpp decode output.huf restored.txt
175+
176+ # Huffman - Go
177+ ./algorithms/huffman/go/huffman_go encode input.txt output.huf
178+ ./algorithms/huffman/go/huffman_go decode output.huf restored.txt
179+
180+ # Huffman - Rust
181+ ./algorithms/huffman/rust/huffman_rust encode input.txt output.huf
182+ ./algorithms/huffman/rust/huffman_rust decode output.huf restored.txt
183+
184+ # All tools support --help for detailed options
185+ ./algorithms/huffman/go/huffman_go --help
186+ ```
187+
188+ ### Go Library
120189
121190``` go
122- import " huffman"
191+ import " github.com/LessUp/encoding/algorithms/ huffman/go "
123192
124193err := huffman.EncodeFile (" input.bin" , " output.huf" )
125194err = huffman.DecodeFile (" output.huf" , " decoded.bin" )
126195```
127196
197+ Note: When using as a library, import the package and call functions directly. For standalone CLI usage, build with ` go build -o huffman_go ./cmd ` .
198+
128199## 📚 Documentation
129200
130201| Resource | Link |
@@ -151,6 +222,17 @@ This project follows **Spec-Driven Development (SDD)**:
151222
152223See [ Contributing Guide] ( https://lessup.github.io/encoding/en/guide/contributing ) for details.
153224
225+ ## ⚠️ Security Notes
226+
227+ - ** Maximum input size:** 4 GiB per file
228+ - ** Maximum output size:** 1 GiB (protection against decompression bombs)
229+ - All binary formats include integrity validation
230+ - File formats are stable and backward compatible within major versions
231+
232+ ## 📜 Changelog
233+
234+ See [ CHANGELOG.md] ( CHANGELOG.md ) for version history and migration guides.
235+
154236## License
155237
156238[ MIT License] ( LICENSE ) · Copyright © 2025-2026 LessUp
0 commit comments