pub fn encode_to_slice<T>( input: T, output: &mut [u8], ) -> Result<(), FromHexError>where T: AsRef<[u8]>,
Encodes input as a hex string using lowercase characters into a mutable slice of bytes output.
input
output
If the output buffer is not exactly input.len() * 2 bytes long.
input.len() * 2
let mut bytes = [0u8; 4 * 2]; const_hex::encode_to_slice(b"kiwi", &mut bytes)?; assert_eq!(&bytes, b"6b697769");