MCPcopy Create free account
hub / github.com/LUX-Core/lux / DecodeBase58Check

Function DecodeBase58Check

src/base58.cpp:140–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

SetStringMethod · 0.85
DecodeDestinationFunction · 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

no test coverage detected