Huffman is my simple text file compressor/decompressor. It uses the technique of Huffman coding by David A. Huffman. For example, it is capable of losslessely compressing English text to about half the size and genomes up to the quarter of the original size, making it always optimal. (However, not that for very small files, the compressed version may even be bigger than the original)
The program is compatible with C99 and uses only the standard library, plugging it into your compiler of choice should be enough (let me know about any issues). You can compile it with GCC on *nix systems or MinGW on Windows with:
gcc src/*.c -Iinclude -o ./huffman
The program always needs three parameters, in this exact order:
- "-c" : Compress the input file, output to the output file
"-ci" : "-c" with debug information
"-d" : Decompress the input file, output to the output file
"-di" : "-d" with debug information - Input file
- Output file
For example, to compress the file file.txt
and output to the file output.huf
, you would use:
huffman -c file.txt output.huf
For a more detailed description, check out the documentation file.