MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / Encode

Function Encode

src/cashaddr.cpp:198–209  ·  view source on GitHub ↗

* Encode a cashaddr string. */

Source from the content-addressed store, hash-verified

196 * Encode a cashaddr string.
197 */
198std::string Encode(const std::string &prefix, const data &payload) {
199 data checksum = CreateChecksum(prefix, payload);
200 data combined = Cat(payload, checksum);
201 std::string ret = prefix + ':';
202
203 ret.reserve(ret.size() + combined.size());
204 for (uint8_t c : combined) {
205 ret += CHARSET[c];
206 }
207
208 return ret;
209}
210
211/**
212 * Decode a cashaddr string.

Callers 7

encodeMethod · 0.85
operator()Method · 0.85
EncodeCashAddrFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85
CashAddrEncodeFunction · 0.85

Calls 4

CreateChecksumFunction · 0.85
CatFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45

Tested by 3

BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68