| 131 | } |
| 132 | |
| 133 | std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn) |
| 134 | { |
| 135 | // add 4-byte hash check to the end |
| 136 | std::vector<unsigned char> vch(vchIn); |
| 137 | uint256 hash = Hash(vch.begin(), vch.end()); |
| 138 | vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4); |
| 139 | return EncodeBase58(vch); |
| 140 | } |
| 141 | |
| 142 | bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet) |
| 143 | { |