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

Function serialize

Source
pub fn serialize<S, T>(
    data: T,
    serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer, T: ToHex,
Available on crate feature alloc only.
Expand description

Serializes data as hex string using lowercase characters.

Lowercase characters are used (e.g. f9b4ca). The resulting string’s length is always even, each byte in data is always encoded using two hex digits. Thus, the resulting string contains exactly twice as many bytes as the input data.