decode


Description:

public static Result<Bytes,Error> decode (string hex)

Decodes a hexadecimal string into bytes.

Returns Result.error for invalid input (odd length or non-hex characters).

Parameters:

hex

hexadecimal text.

Returns:

Result.ok(decoded bytes), or Result.error(HexError.INVALID_ARGUMENT/PARSE) on invalid input.