Crates.io | huff-tree-tap |
lib.rs | huff-tree-tap |
version | 0.0.5 |
source | src |
created_at | 2021-05-12 13:01:04.0316 |
updated_at | 2024-08-27 16:38:25.879314 |
description | Huffman Encoder and Decoder Library |
homepage | |
repository | https://github.com/chimbosonic/huff-tree-tap/ |
max_upload_size | |
id | 396513 |
size | 32,589 |
Huffman Encoder and Decoder Library
Cargo.toml:
[dependencies]
huff_tree_tap = "*" # You can specify a version here if you want
extern crate huff_tree_tap;
use huff_tree_tap::*;
use std::collections::HashMap;
let data: Vec<u8> = "this is a test string!".to_string().into_bytes();
let huffman_data: HuffmanData = HuffmanData::new(&data).unwrap();
let decoded_data: Vec<u8> = huffman_data.decode().unwrap();
assert_eq!(decoded_data,data);