forge::revm::interpreter::primitives::alloy_primitives::hex::hex

Function encode_upper

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

Encodes data as hex string using uppercase characters.

Apart from the characters’ casing, this works exactly like encode().

§Example

assert_eq!(hex::encode_upper("Hello world!"), "48656C6C6F20776F726C6421");
assert_eq!(hex::encode_upper(vec![1, 2, 3, 15, 16]), "0102030F10");