Skip to main content

encode_short_string_bytes32

Function encode_short_string_bytes32 

pub fn encode_short_string_bytes32(
    value: &str,
) -> Result<FixedBytes<32>, ShortStringEncodingError>
Expand description

Encode a UTF-8 string into the canonical OpenZeppelin ShortStrings bytes32 layout.

Empty strings are encoded canonically as bytes32(0).