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