https://github.com/andreip/huffman-tar
Compression Tool using Huffman Trees
https://github.com/andreip/huffman-tar
Last synced: about 1 year ago
JSON representation
Compression Tool using Huffman Trees
- Host: GitHub
- URL: https://github.com/andreip/huffman-tar
- Owner: andreip
- Created: 2011-05-24T13:57:01.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2014-09-15T15:39:36.000Z (almost 12 years ago)
- Last Synced: 2025-02-12T12:57:00.419Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 122 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
It's a compression tool like `tar czf file.zip file1 file2 ...`, but it does compression
by using the huffman coding trees.
It does not work with directories, only with simple files for simplicity.
# How it works
Follow the below steps and see it working
```bash
# compile huffman project
$ make
# compress similar to tar syntax
$ ./hufftar compress out.huff file1 file2 ...
$ ls -l out.huff
# decompress to folder 1/
$ mkdir 1/
$ ./hufftar extract out.huff 1/
# list the .huff compressed files
$ ./hufftar list out.huff
```
# Get convinced it actually compresses
```bash
$ ./hufftar compress out.huff file1 file2 ...
$ tar cf out.tar file1 file2 ...
# Compare their sizes, out.tar only puts the files file1,file2 together without compression
# While out.huff should be significantly lower.
$ ls -l out.huff out.tar
```