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

Function DecodeBase58Check

src/base58.cpp:142–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)
143{
144 if (!DecodeBase58(psz, vchRet) ||
145 (vchRet.size() < 4)) {
146 vchRet.clear();
147 return false;
148 }
149 // re-calculate the checksum, ensure it matches the included 4-byte checksum
150 uint256 hash = Hash(vchRet.begin(), vchRet.end() - 4);
151 if (memcmp(&hash, &vchRet[vchRet.size() - 4], 4) != 0) {
152 vchRet.clear();
153 return false;
154 }
155 vchRet.resize(vchRet.size() - 4);
156 return true;
157}
158
159bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet)
160{

Callers 6

ConvertAddressFormatFunction · 0.85
DecodeDestinationFunction · 0.85
DecodeSecretFunction · 0.85
DecodeExtPubKeyFunction · 0.85
DecodeExtKeyFunction · 0.85
ConvertAddressFormatFunction · 0.85

Calls 7

DecodeBase58Function · 0.85
HashFunction · 0.70
sizeMethod · 0.45
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
resizeMethod · 0.45

Tested by 1

ConvertAddressFormatFunction · 0.68