Function hex::encode_to_slice
source · [−]Expand description
Encodes some bytes into a mutable slice of bytes.
The output buffer, has to be able to hold at least input.len() * 2
bytes,
otherwise this function will return an error.
Example
let mut bytes = [0u8; 4 * 2];
hex::encode_to_slice(b"kiwi", &mut bytes)?;
assert_eq!(&bytes, b"6b697769");