mirror of
https://github.com/edg-l/rustyman.git
synced 2024-11-22 07:58:20 +00:00
Create README.md
This commit is contained in:
parent
16d5c333a7
commit
6ba2e2cb12
15
README.md
Normal file
15
README.md
Normal 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)
|
||||||
|
```
|
Loading…
Reference in a new issue