From 6ba2e2cb12eaee4c400cb42533df98f53d462b84 Mon Sep 17 00:00:00 2001 From: Edgar Date: Tue, 25 Oct 2022 13:13:48 +0200 Subject: [PATCH] Create README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ab65ffa --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# rustyman +Huffman compression and decompression implemented in rust + +```rust +use rustyman::Huffman; + +let payload = b"hello from the other side of the river"; + +let huffman = Huffman::new_from_data(payload); +let compressed = huffman.compress(payload); +let decompressed = huffman.decompress(&compressed); + +assert!(compressed.len() < payload.len()); +assert_eq!(&payload[..], decompressed) +```