Simple command line programm to compress files using optimal huffman codes.
Generates the optimal huffman tree for a given file, compresses the file using that, and stores the tree in the resulting compressed file.
- You need cargo. If you don't have it installed already you can do so by following the steps from The Cargo Book
- Run
cargo install --git https://github.com/devensiv/huffman-coding
to build the crate in a temporary target directory before installing the binaries in your cargo installation'sbin
folder. For more information check out the cargo install Book entry - Alternatively to 2. you can clone the repository move into
huffman-coding/
in order to runcargo install --path .
. This has the same effect as 2. but you are not building in a temporary target directory
You can update your installation by re running the cargo install command. (or pulling changes before if you went with 3.)
Encode file: huffman <original-file>
Decode file: huffman <compressed-file> -d
In case you want to uninstall the huffman-coding you can
- Run
cargo uninstall huffman
to remove the program - In case you installed
cargo
(with rustup) just for this program and want to uninstall it too you can do so by runningrustup self uninstall
which will uninstallrustup
and all its components.