MCPcopy Create free account
hub / github.com/ElementsProject/elements / ParseHex

Function ParseHex

src/util/strencodings.cpp:84–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84std::vector<unsigned char> ParseHex(const char* psz)
85{
86 // convert hex dump to vector
87 std::vector<unsigned char> vch;
88 while (true)
89 {
90 while (IsSpace(*psz))
91 psz++;
92 signed char c = HexDigit(*psz++);
93 if (c == (signed char)-1)
94 break;
95 auto n{uint8_t(c << 4)};
96 c = HexDigit(*psz++);
97 if (c == (signed char)-1)
98 break;
99 n |= c;
100 vch.push_back(n);
101 }
102 return vch;
103}
104
105std::vector<unsigned char> ParseHex(const std::string& str)
106{

Callers 15

rest_getutxosFunction · 0.85
MutateTxAddOutPubKeyFunction · 0.85
MutateTxAddOutMultiSigFunction · 0.85
MutateTxAddOutDataFunction · 0.85
authchallenge_cbMethod · 0.85
ProcessMessageMethod · 0.85
CreateGenesisBlockFunction · 0.85
SigNetParamsMethod · 0.85
UpdateFromArgsMethod · 0.85
CLiquidV1ParamsMethod · 0.85
CLiquidV1TestParamsMethod · 0.85

Calls 3

IsSpaceFunction · 0.85
HexDigitFunction · 0.85
push_backMethod · 0.45

Tested by 15

BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
RunTestFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68