MCPcopy Create free account
hub / github.com/ElementsProject/elements / EncodeDumpString

Function EncodeDumpString

src/wallet/rpc/backup.cpp:54–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53namespace wallet {
54std::string static EncodeDumpString(const std::string &str) {
55 std::stringstream ret;
56 for (const unsigned char c : str) {
57 if (c <= 32 || c >= 128 || c == '%') {
58 ret << '%' << HexStr({&c, 1});
59 } else {
60 ret << c;
61 }
62 }
63 return ret.str();
64}
65
66static std::string DecodeDumpString(const std::string &str) {
67 std::stringstream ret;

Callers 1

backup.cppFile · 0.85

Calls 2

strMethod · 0.80
HexStrFunction · 0.50

Tested by

no test coverage detected