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

Function DecodeExtPubKey

src/key_io.cpp:412–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412CExtPubKey DecodeExtPubKey(const std::string& str)
413{
414 CExtPubKey key;
415 std::vector<unsigned char> data;
416 if (DecodeBase58Check(str, data, 78)) {
417 const std::vector<unsigned char>& prefix = Params().Base58Prefix(CChainParams::EXT_PUBLIC_KEY);
418 if (data.size() == BIP32_EXTKEY_SIZE + prefix.size() && std::equal(prefix.begin(), prefix.end(), data.begin())) {
419 key.Decode(data.data() + prefix.size());
420 }
421 }
422 return key;
423}
424
425std::string EncodeExtPubKey(const CExtPubKey& key)
426{

Callers 5

initpegoutwalletFunction · 0.85
ParsePubkeyInnerFunction · 0.85
RunTestFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGET_INITFunction · 0.85

Calls 7

DecodeBase58CheckFunction · 0.85
ParamsClass · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
DecodeMethod · 0.45
dataMethod · 0.45

Tested by 3

RunTestFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGET_INITFunction · 0.68