util: make EncodeBase58Check consume Spans

This commit is contained in:
Sebastian Falbesoner committed 2020-08-12 16:25:50 +02:00
1 parent f0fce0675d
commit 356988e200
3 files changed
+5 -7

No files matched your search

+2 -2
View File
@@ -132,10 +132,10 @@ bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet, in
return DecodeBase58(str.c_str(), vchRet, max_ret_len);
}
std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)
std::string EncodeBase58Check(Span<const unsigned char> input)
{
// add 4-byte hash check to the end
std::vector<unsigned char> vch(vchIn);
std::vector<unsigned char> vch(input.begin(), input.end());
uint256 hash = Hash(vch);
vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
return EncodeBase58(vch);