Skip to content

Repository files navigation

CompressKit

使用 C++17 实现的经典无损压缩算法。

CI Status License

CompressKit 是一个面向学习与验证的压缩算法仓库:同一组经典算法用 C++17 实现,通过统一命令行契约和 round-trip 测试验证正确性。 它不是黑盒压缩库,而是可以阅读、运行、对比和验证的算法实验室。

📖 在线文档https://aicl-lab.github.io/compress-kit/

文档站包含算法详解、架构设计、API 参考与基准测试结果。如需本地预览:

cd docs && npm ci && npm run dev

包含内容

算法 适用场景
Huffman 编码 通用文本/数据,学习前缀码
算术编码 理解熵编码与压缩率对比
区间编码 对比算术编码风格实现
RLE 行程编码 高重复数据与简单格式学习

所有命令行工具都遵循:

<binary> <encode|decode> <input> <output>

快速开始

git clone https://github.com/AICL-Lab/compress-kit.git
cd compress-kit

make build
make test

快速 round-trip 验证:

printf "Hello CompressKit\n" > input.txt
./build/huffman_cpp encode input.txt output.huf
./build/huffman_cpp decode output.huf restored.txt
diff input.txt restored.txt

仓库结构

algorithms/
  huffman/cpp/      # Huffman 编码 CLI
  arithmetic/cpp/   # 算术编码 CLI
  range/cpp/        # 区间编码 CLI
  rle/cpp/          # RLE 行程编码 CLI
  shared/cpp/       # 公共库(序列化、位读写、频率表、CLI 框架)
docs/               # VitePress 中文文档站
tests/              # 测试语料生成与 CLI smoke 测试

工程基线

命令 用途
make build 构建全部 C++ CLI 工具(CMake)
make test 运行单元测试与 CLI smoke 测试
make lint clang-format dry-run

许可证

MIT 许可证 · 版权所有 © 2025-2026 AICL-Lab

About

Classic lossless compression algorithms in C++17 with round-trip verification | 经典无损压缩算法,C++17 实现,round-trip 验证

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages