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

Function DecodeBase58Check

src/commons/base58.cpp:118–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118bool DecodeBase58Check(const char* psz, vector<unsigned char>& vchRet) {
119 if (!DecodeBase58(psz, vchRet) || (vchRet.size() < 4)) {
120 vchRet.clear();
121 return false;
122 }
123 // re-calculate the checksum, insure it matches the included 4-byte checksum
124 uint256 hash = Hash(vchRet.begin(), vchRet.end() - 4);
125 if (memcmp(&hash, &vchRet.end()[-4], 4) != 0) {
126 vchRet.clear();
127 return false;
128 }
129 vchRet.resize(vchRet.size() - 4);
130 return true;
131}
132
133bool DecodeBase58Check(const string& str, vector<unsigned char>& vchRet) {
134 return DecodeBase58Check(str.c_str(), vchRet);

Callers 1

SetStringMethod · 0.85

Calls 7

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

Tested by

no test coverage detected