tuweni / org.apache.tuweni.bytes / Bytes32 / fromHexStringLenient

fromHexStringLenient

open static fun fromHexStringLenient(str: CharSequence!): Bytes32! (source)

Parse a hexadecimal string into a Bytes32.

This method is lenient in that str may of an odd length, in which case it will behave exactly as if it had an additional 0 in front.

Parameters

str - CharSequence!: The hexadecimal string to parse, which may or may not start with "0x". That representation may contain less than 32 bytes, in which case the result is left padded with zeros (see #fromHexStringStrict if this is not what you want).

Exceptions

IllegalArgumentException - if str does not correspond to a valid hexadecimal representation or contains more than 32 bytes.

Return
Bytes32!: The value corresponding to str.