aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-26 10:17:45 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-26 10:17:45 +0200
commit81ae67c934e58ba65c37244ccf21f7cd469ade3e (patch)
treea35135a3ec073db01769e07867366e9cdcac5930 /README.md
parentc4184968ec1cf9bcf8a9305ce858d5a56d34468d (diff)
downloadhuffman-81ae67c934e58ba65c37244ccf21f7cd469ade3e.tar.gz
huffman-81ae67c934e58ba65c37244ccf21f7cd469ade3e.tar.bz2
huffman-81ae67c934e58ba65c37244ccf21f7cd469ade3e.zip
Added serialization
Diffstat (limited to 'README.md')
-rw-r--r--README.md18
1 files changed, 16 insertions, 2 deletions
diff --git a/README.md b/README.md
index 74ef205..75fb0ad 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,23 @@
# huffman
-Implementation of [Huffman coding](https://en.wikipedia.org/wiki/Huffman_coding?oldformat=true) made for educational purposes.
+Implementation of the [Huffman coding](https://en.wikipedia.org/wiki/Huffman_coding?oldformat=true) made for educational purposes.
## Usage
+* compress: `cargo run < input_file > output_file.huffman`
+* decompress: `cargo run d < input_file.huffman > output_file`
+
`python3 draft.py [file_name]` to run the python draft.
-`cargo run [file_name]` for the real thing.
+## File format
+
+Compress to a custom `.huffman` file format which is a header of the huffman coding tree followed by the compressed content.
+
+
+### Header format
+
+4 byte unsigned int: header size (including this field)
+Conversion table where each entry's format is:
+ 1 byte for the actual byte value
+ 1 byte for size of representation in bits
+ the representation aligned on a 8-bit boundary