Bitcoin Core 28.99.0
P2P Digital Currency
Functions
detail Namespace Reference

Functions

template<class uintN_t >
std::optional< uintN_t > FromHex (std::string_view str)
 Writes the hex string (in reverse byte order) into a new uintN_t object and only returns a value iff all of the checks pass: More...
 
template<class uintN_t >
std::optional< uintN_t > FromUserHex (std::string_view input)
 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. More...
 

Function Documentation

◆ FromHex()

template<class uintN_t >
std::optional< uintN_t > detail::FromHex ( std::string_view  str)

Writes the hex string (in reverse byte order) into a new uintN_t object and only returns a value iff all of the checks pass:

  • Input length is uintN_t::size()*2
  • All characters are hex

Definition at line 146 of file uint256.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromUserHex()

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

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.

Designed to be used when dealing with user input.

Definition at line 161 of file uint256.h.

Here is the call graph for this function: