Parser Zip File Compressor program utilizes Huffman coding to efficiently compress and decompress files without any data loss.
This is a C language implementation of the Huffman compression algorithm, a popular lossless data compression technique. The algorithm works by assigning variable-length codes to each symbol in a message based on their frequency of occurrence, with more frequent symbols assigned shorter codes.
1. Sample1.txt
- Original File size: 17,01,978 bytes
- Compressed File size: 9,26,037 bytes
- Compression Rate: ~45.6%
Run the batch file:
./Makefile.bat
(or) Execute the command:
gcc -Wall -save-temps "client.c" "encode.c" "decode.c" "huffman.c" -o ""Huffman.exe"
For compressing the file
Use -encode
as flag
For reverting to original file
Use -decode
as flag
To start executing
./Huffman.exe <flag> <filepath>
Example: For Encoding the sample1.txt file
./Huffman.exe -encode "./Example/sample1.txt"
For decoding the sample1.txt.huff file
./Huffman.exe -decode "./Example/sample1.txt.huff"
This project follows the MIT LICENSE.