MCPcopy Create free account
hub / github.com/LUX-Core/lux / Encode

Function Encode

src/bech32.cpp:153–162  ·  view source on GitHub ↗

Encode a Bech32 string. */

Source from the content-addressed store, hash-verified

151
152/** Encode a Bech32 string. */
153std::string Encode(const std::string& hrp, const data& values) {
154 data checksum = CreateChecksum(hrp, values);
155 data combined = Cat(values, checksum);
156 std::string ret = hrp + '1';
157 ret.reserve(ret.size() + combined.size());
158 for (auto c : combined) {
159 ret += CHARSET[c];
160 }
161 return ret;
162}
163
164/** Decode a Bech32 string. */
165std::pair<std::string, data> Decode(const std::string& str) {

Callers 6

SerializeMethod · 0.85
operator()Method · 0.85
SerializeMethod · 0.85
integer.cppFile · 0.85
EncodeMethod · 0.85

Calls 4

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

Tested by

no test coverage detected