TextCompression

< Go back

A command line driven c++ program that uses a greedy approach using Huffman Coding algorithm to compress text based, and any binary file that has an uneven distribution of the possible 8 bit values in it.

Build

g++ main.cpp

Usage

To compress a file

./huffman [input file name] [output file name]
./huffman -c/--compress [input file name] [output file name]

To decompress a file

./huffman -d/--decompress [input file name] [output file name]

To show help

./huffman -h/--help
Contact
220 smtp.example.com ESMTP Postfix
HELO client.example.com
250 smtp.example.com
MAIL FROM: <me@mydomain.com>
250 Ok
RCPT TO: <hi@zaeem.dev>
250 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
From: "Me" <me@mydomain.com>
To: "Jasir" <hi@zaeem.dev>
Date: $Tue, 16 Sep 2025 17:17:43 GMT
Subject: Complaint Mail

Hi Jasir,
Your site gave me a virus. I am very upset.
Yours truly,
Me
.
250 Ok: queued as 12345
QUIT
221 Bye

Say Hi!

You can reach me at mailto:hi@zaeem.dev

Site best viewed at 1920x1080 in Your Browser