This project is a custom implementation of a compression and decompression tool based on Huffman coding. It was created as part of a coding challenge here. The utility is designed to compress and decompress files efficiently using Huffman coding. It includes support for both compression and decompression through a command-line interface (CLI).
- Compress files using Huffman coding.
- Decompress files back to their original state.
- Validate compressed files for structural correctness.
- Command-line interface (CLI) powered by Cobra for easy usage.
- Supports file sizes up to 100MB for compression and decompression.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- You need to have Go installed on your machine (Go 1.15 or later is recommended).
- You can download and install Go from https://golang.org/dl/.
Clone the repository to your local machine:
git clone https://github.com/nullsploit01/cc-compressor
cd cccmp
Compile the project using:
go build -o cccmp
Run all tests:
go test ./...
To run the utility, you can either compress or decompress files using the following commands:
./cccmp -c path/to/inputfile.txt -o path/to/outputfile.txt
./cccmp -d path/to/inputfile.txt -o path/to/outputfile.txt
# Compressing a file
./cccmp -c test_data/les_miserables.txt -o compressed.txt
# Decompressing a file
./cccmp -d compressed.txt -o decompressed.txt