tuweni / org.apache.tuweni.bytes / Bytes32 / fromHexStringStrict

fromHexStringStrict

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

Parse a hexadecimal string into a Bytes32.

This method is extra strict in that str must of an even length and the provided representation must have exactly 32 bytes.

Parameters

str - CharSequence!: The hexadecimal string to parse, which may or may not start with "0x".

Exceptions

IllegalArgumentException - if str does not correspond to a valid hexadecimal representation, is of an odd length or does not contain exactly 32 bytes.

Return
Bytes32!: The value corresponding to str.