Function encode_to_vec

Source
pub fn encode_to_vec(input: &[u8], output: &mut Vec<u8>) -> usize
Expand description

Encode the given input, and append the result to output. Returns the number of bytes appended.

ยงExample

let mut output = vec![];
let count = tick_encoding::encode_to_vec("hello, world! ๐Ÿ™‚".as_bytes(), &mut output);
assert_eq!(output, b"hello, world! `F0`9F`99`82");
assert_eq!(count, 26);