Create README.md

This commit is contained in:
Edgar 2022-10-25 13:13:48 +02:00 committed by GitHub
parent 16d5c333a7
commit 6ba2e2cb12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

15
README.md Normal file
View file

@ -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)
```