MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / SetString

Method SetString

src/base58.cpp:162–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)
163{
164 std::vector<unsigned char> vchTemp;
165 bool rc58 = DecodeBase58Check(psz, vchTemp);
166 if ((!rc58) || (vchTemp.size() < nVersionBytes)) {
167 vchData.clear();
168 vchVersion.clear();
169 return false;
170 }
171 vchVersion.assign(vchTemp.begin(), vchTemp.begin() + nVersionBytes);
172 vchData.resize(vchTemp.size() - nVersionBytes);
173 if (!vchData.empty())
174 memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size());
175 memory_cleanse(&vchTemp[0], vchTemp.size());
176 return true;
177}
178
179bool CBase58Data::SetString(const std::string& str)
180{

Callers 9

MutateTxSignFunction · 0.80
signrawtransactionFunction · 0.80
importprivkeyFunction · 0.80
importwalletFunction · 0.80
dumpprivkeyFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 8

DecodeBase58CheckFunction · 0.85
memcpyFunction · 0.85
memory_cleanseFunction · 0.85
resizeMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45
beginMethod · 0.45
emptyMethod · 0.45

Tested by 4

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64