const_hex

Function encode_upper_prefixed

Source
pub fn encode_upper_prefixed<T: AsRef<[u8]>>(data: T) -> String
Available on crate feature alloc only.
Expand description

Encodes data as a prefixed hex string using uppercase characters.

See encode_upper() for more details.

ยงExamples

assert_eq!(const_hex::encode_upper_prefixed("Hello world!"), "0x48656C6C6F20776F726C6421");
assert_eq!(const_hex::encode_upper_prefixed([1, 2, 3, 15, 16]), "0x0102030F10");