Skip to main content

hex_string_upper

Function hex_string_upper 

Source
pub fn hex_string_upper<const N: usize>(src: &[u8]) -> Result<String<N>, Error>
Available on crate feature heapless-08 only.
Expand description

Encodes src as an uppercase hexadecimal string with inline capacity N.

This has the ownership and allocation-free behavior of hex_string, using A through F for letter digits. Capacity counts encoded characters.

§Errors

Returns Error::Overflow or Error::OutputTooSmall under the same conditions as hex_string.

§Examples

assert_eq!(faster_hex::heapless_08::hex_string_upper::<4>(&[0xab, 1])?.as_str(),
           "AB01");