| 221 | } |
| 222 | |
| 223 | std::string encode_addr(uint64_t tag, const BinaryArray &data) { |
| 224 | BinaryArray buf = get_varint_data(tag); |
| 225 | append(buf, data.begin(), data.end()); |
| 226 | crypto::Hash hash = crypto::cn_fast_hash(buf.data(), buf.size()); |
| 227 | append(buf, hash.data, hash.data + addr_checksum_size); |
| 228 | return encode(buf); |
| 229 | } |
| 230 | |
| 231 | bool decode_addr(std::string addr, uint64_t *tag, BinaryArray *data) { |
| 232 | BinaryArray addr_data; |
no test coverage detected