MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / IsHex

Function IsHex

src/util/strencodings.cpp:40–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40bool IsHex(std::string_view str)
41{
42 for (char c : str) {
43 if (HexDigit(c) < 0) return false;
44 }
45 return (str.size() > 0) && (str.size()%2 == 0);
46}
47
48template <typename Byte>
49std::optional<std::vector<Byte>> TryParseHex(std::string_view str)

Callers 15

MutateTxAddOutDataFunction · 0.85
ParseHexUVFunction · 0.85
ParseScriptFunction · 0.85
DecodeHexTxFunction · 0.85
DecodeHexBlockHeaderFunction · 0.85
DecodeHexBlkFunction · 0.85
FromHexFunction · 0.85
CreateFromDumpFunction · 0.85
FundTransactionFunction · 0.85
ParsePubkeyInnerFunction · 0.85
ParsePubkeyFunction · 0.85
ParseScriptFunction · 0.85

Calls 2

HexDigitFunction · 0.85
sizeMethod · 0.45

Tested by 3

BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68
CheckedParseHexFunction · 0.68