[−][src]Function httlib_huffman::encode::encode
pub fn encode(src: &[u8], dst: &mut Vec<u8>) -> Result<(), EncodeError>
Encodes the provided src
bytes and populates the dst
with the sequance
of Huffman codes.
use httlib_huffman::encode;
let mut sequence = Vec::new();
let text = "Hello world!".as_bytes();
match encode(&text, &mut sequence)?;