Skip to content

AICL-Lab/compress-kit

Repository files navigation

CompressKit

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

CI Status License

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

包含内容

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

所有命令行工具都遵循:

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

快速开始

git clone https://github.com/LessUp/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、arithmetic、range、rle;每个算法含 cpp/
tests/        # 生成语料、CLI smoke 测试

工程基线

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

许可证

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

About

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

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors