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

Function DecodeExtKey

src/key_io.cpp:435–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435CExtKey DecodeExtKey(const std::string& str)
436{
437 CExtKey key;
438 std::vector<unsigned char> data;
439 if (DecodeBase58Check(str, data, 78)) {
440 const std::vector<unsigned char>& prefix = Params().Base58Prefix(CChainParams::EXT_SECRET_KEY);
441 if (data.size() == BIP32_EXTKEY_SIZE + prefix.size() && std::equal(prefix.begin(), prefix.end(), data.begin())) {
442 key.Decode(data.data() + prefix.size());
443 }
444 }
445 return key;
446}
447
448std::string EncodeExtKey(const CExtKey& key)
449{

Callers 4

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