MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / DecodeExtPubKey

Function DecodeExtPubKey

src/key_io.cpp:162–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162CExtPubKey DecodeExtPubKey(const std::string& str)
163{
164 CExtPubKey key;
165 std::vector<unsigned char> data;
166 if (DecodeBase58Check(str, data)) {
167 const std::vector<unsigned char>& prefix = Params().Base58Prefix(CChainParams::EXT_PUBLIC_KEY);
168 if (data.size() == BIP32_EXTKEY_SIZE + prefix.size() && std::equal(prefix.begin(), prefix.end(), data.begin())) {
169 key.Decode(data.data() + prefix.size());
170 }
171 }
172 return key;
173}
174
175std::string EncodeExtPubKey(const CExtPubKey& key)
176{

Callers 2

ParsePubkeyFunction · 0.85
RunTestFunction · 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 1

RunTestFunction · 0.68