| 108 | } |
| 109 | |
| 110 | string EncodeBase58Check(const vector<unsigned char>& vchIn) { |
| 111 | // add 4-byte hash check to the end |
| 112 | vector<unsigned char> vch(vchIn); |
| 113 | uint256 hash = Hash(vch.begin(), vch.end()); |
| 114 | vch.insert(vch.end(), (unsigned char*) &hash, (unsigned char*) &hash + 4); |
| 115 | return EncodeBase58(vch); |
| 116 | } |
| 117 | |
| 118 | bool DecodeBase58Check(const char* psz, vector<unsigned char>& vchRet) { |
| 119 | if (!DecodeBase58(psz, vchRet) || (vchRet.size() < 4)) { |