forge::revm::interpreter::primitives::alloy_primitives::hexFunction encode_to_slice_upper
pub fn encode_to_slice_upper<T>(
input: T,
output: &mut [u8],
) -> Result<(), FromHexError>
Expand description
Encodes input
as a hex string using uppercase characters into a mutable
slice of bytes output
.
§Errors
If the output buffer is not exactly input.len() * 2
bytes long.
§Examples
let mut bytes = [0u8; 4 * 2];
const_hex::encode_to_slice_upper(b"kiwi", &mut bytes)?;
assert_eq!(&bytes, b"6B697769");