Like FromHex(std::string_view str), but allows an "0x" prefix and pads the input with leading zeroes if it is shorter than the expected length of uintN_t::size()*2.

Synopsis

Declared in <uint256.h>

template<class uintN_t>
std::optional<uintN_t>
FromUserHex(std::string_view input);

Description

Designed to be used when dealing with user input.

Return Value

The parsed value, or std::nullopt if the input is invalid.

Parameters

Name

Description

input

The hex string to parse, optionally prefixed with "0x".

Created with MrDocs