encode_to_str_upper

Function encode_to_str_upper 

Source
pub fn encode_to_str_upper<T: AsRef<[u8]>>(
    input: T,
    output: &mut [u8],
) -> Result<&mut str, FromHexError>
Expand description

Encodes input as a hex string using uppercase characters into a mutable slice of bytes output. Returns the slice to output reinterpreted as str.

§Errors

If the output buffer is not exactly input.len() * 2 bytes long.

§Examples

let mut bytes = [0u8; 4 * 2];
let s = const_hex::encode_to_str_upper(b"kiwi", &mut bytes)?;
assert_eq!(s, "6B697769");