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

Method SetString

src/base58.cpp:181–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)
182{
183 std::vector<unsigned char> vchTemp;
184 bool rc58 = DecodeBase58Check(psz, vchTemp);
185 if ((!rc58) || (vchTemp.size() < nVersionBytes)) {
186 vchData.clear();
187 vchVersion.clear();
188 return false;
189 }
190 vchVersion.assign(vchTemp.begin(), vchTemp.begin() + nVersionBytes);
191 vchData.resize(vchTemp.size() - nVersionBytes);
192 if (!vchData.empty())
193 memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size());
194 memory_cleanse(&vchTemp[0], vchData.size());
195 return true;
196}
197
198bool CBase58Data::SetString(const std::string& str)
199{

Callers 10

MutateTxSignFunction · 0.80
SignMethod · 0.80
importprivkeyFunction · 0.80
importwalletFunction · 0.80
SetKeyMethod · 0.80
signrawtransactionFunction · 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 9

DecodeBase58CheckFunction · 0.85
memcpyFunction · 0.85
memory_cleanseFunction · 0.85
sizeMethod · 0.45
clearMethod · 0.45
assignMethod · 0.45
beginMethod · 0.45
resizeMethod · 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