Skip to content

Commit 180b7d7

Browse files
committed
feat: 更新依赖项,添加 Vue 相关库和前置要求文档
1 parent add29e1 commit 180b7d7

5 files changed

Lines changed: 286 additions & 40 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,7 @@ specs-backup-*.tar.gz
8080
# Logs & temp
8181
*.log
8282
*.tmp
83+
84+
# BMad Method V6
85+
_bmad/
86+
_bmad-output/

README.md

Lines changed: 86 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@
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
7391
git clone https://github.com/LessUp/encoding.git
7492
cd 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

124193
err := huffman.EncodeFile("input.bin", "output.huf")
125194
err = 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

152223
See [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

README.zh-CN.md

Lines changed: 86 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@
3636

3737
---
3838

39+
## 📋 前置要求
40+
41+
| 语言 | 最低版本 | 安装方式 |
42+
|------|----------|----------|
43+
| C++ | GCC 9+ / Clang 10+ | `apt install g++``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+ | 仅需用于生成测试数据 |
47+
48+
验证环境:
49+
```bash
50+
g++ --version # 必须支持 -std=c++17
51+
go version
52+
rustc --version
53+
```
54+
55+
---
56+
3957
## ✨ 特性
4058

4159
- 🔤 **多语言实现** — C++17、Go 1.21+、Rust 1.70+ 三种语言完整实现
@@ -72,10 +90,34 @@
7290
```bash
7391
git clone https://github.com/LessUp/encoding.git
7492
cd encoding
75-
make build && make test
93+
94+
# 1. 构建所有实现
95+
make build
96+
97+
# 2. 生成测试数据(需要 Python 3.8+)
98+
make test-data
99+
100+
# 3. 运行测试
101+
make test
102+
```
103+
104+
### 快速验证
105+
106+
```bash
107+
# 创建测试文件
108+
echo "Hello, World! Hello, World!" > input.txt
109+
110+
# 使用 C++ 编码
111+
./algorithms/huffman/cpp/huffman_cpp encode input.txt output.huf
112+
113+
# 使用 Go 解码
114+
./algorithms/huffman/go/huffman_go decode output.huf restored.txt
115+
116+
# 验证
117+
diff input.txt restored.txt && echo "✓ 跨语言验证通过"
76118
```
77119

78-
### 跨语言验证
120+
### 跨语言验证(替代方式)
79121

80122
```bash
81123
# 使用 C++ 编码
@@ -116,15 +158,44 @@ encoding/
116158
| `make bench` | 运行基准测试 |
117159
| `make clean` | 清理构建产物 |
118160

119-
## Go 库使用
161+
## 💻 使用方法
162+
163+
所有实现遵循统一的 CLI 接口:
164+
165+
```bash
166+
<可执行文件> <encode|decode> <输入> <输出>
167+
```
168+
169+
### CLI 示例
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+
# 所有工具都支持 --help 查看详细选项
185+
./algorithms/huffman/go/huffman_go --help
186+
```
187+
188+
### Go 库使用
120189

121190
```go
122-
import "huffman"
191+
import "github.com/LessUp/encoding/algorithms/huffman/go"
123192

124193
err := huffman.EncodeFile("input.bin", "output.huf")
125194
err = huffman.DecodeFile("output.huf", "decoded.bin")
126195
```
127196

197+
注意:作为库使用时直接导入包调用函数。独立 CLI 使用请用 `go build -o huffman_go ./cmd` 构建。
198+
128199
## 📚 文档
129200

130201
| 资源 | 链接 |
@@ -151,6 +222,17 @@ err = huffman.DecodeFile("output.huf", "decoded.bin")
151222

152223
详见 [贡献指南](https://lessup.github.io/encoding/zh/guide/contributing)
153224

225+
## ⚠️ 安全说明
226+
227+
- **最大输入文件大小:** 4 GiB
228+
- **最大输出文件大小:** 1 GiB(防止解压炸弹攻击)
229+
- 所有二进制格式包含完整性校验
230+
- 文件格式在主要版本内稳定且向后兼容
231+
232+
## 📜 更新日志
233+
234+
查看 [CHANGELOG.md](CHANGELOG.md) 了解版本历史和迁移指南。
235+
154236
## 许可证
155237

156238
[MIT 许可证](LICENSE) · 版权所有 © 2025-2026 LessUp

0 commit comments

Comments
 (0)