百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
H

Huffman-Coding

> 编程语言
开源

基于霍夫曼无损压缩算法和解码器的 C++ 压缩程序。

99 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

基于霍夫曼无损压缩算法和解码器的 C++ 压缩程序。

Huffman Coding

Self-made C++ file archiver and archive extractor programs based on Huffman's lossless compression algorithm

Table of Contents

  • How does it work
    • Compressor
    • Decompressor
  • How to use it?
  • Versions

How does it work?

You can check out documentation inside Compressor.cpp and Decompressor.cpp files to help you understand Huffman's algorithm's inner workings.

Compressor:

The Compressor is a 2-pass program. What I mean by this is that the Compressor reads input files twice.

In the first pass, the program counts usage frequency of every unique byte and creates a weighted translation tree for every used unique byte inversely proportional to its usage frequency and then writes this transformation info to the compressed file for decompression purposes

In the second pass, the program translates input files according to the translation tree and writes it to the newly created compressed file

Decompressor:

The Decompressor is a 1-pass program: The Decompressor first reads translation info and creates a binary tree from it. After this process is done, it uses this binary translation tree to decode the rest of the file

How to use it?

  1. Compile with make using your favourate shell:
make all
  1. After running make, you can use archive command below to compress the file you want:
  • To compress one file use:
./archive {{filename}}
  • To compress multiple files use:
./archive {{filename1}} {{filename2}} ...
  1. And to decompress a compressed file, use the extract command below:
./extract {{filename}}

Versions

  • Version 2.0(Latest Version)
    • Can compress any file and folder you want
    • Useful for educative purposes
    • Uses more functionalized structure
  • Version 1.0
    • Compresses multiple files
    • Version 1.0 can not be used to compress folders
  • Version 0.9
    • Compresses 1 file at a time
    • Version 0.9 can not be used to compress folders
    • Easier to understand
    • Useful for educative purposes

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++compression-algorithmhuffmanhuffman-algorithmhuffman-coding

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言