Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show All 26 Lines | |||||
#include <tuple> | #include <tuple> | ||||
using interfaces::FoundBlock; | using interfaces::FoundBlock; | ||||
static std::string EncodeDumpString(const std::string &str) { | static std::string EncodeDumpString(const std::string &str) { | ||||
std::stringstream ret; | std::stringstream ret; | ||||
for (const uint8_t c : str) { | for (const uint8_t c : str) { | ||||
if (c <= 32 || c >= 128 || c == '%') { | if (c <= 32 || c >= 128 || c == '%') { | ||||
ret << '%' << HexStr(&c, &c + 1); | ret << '%' << HexStr(Span<const uint8_t>(&c, 1)); | ||||
} else { | } else { | ||||
ret << c; | ret << c; | ||||
} | } | ||||
} | } | ||||
return ret.str(); | return ret.str(); | ||||
} | } | ||||
static std::string DecodeDumpString(const std::string &str) { | static std::string DecodeDumpString(const std::string &str) { | ||||
▲ Show 20 Lines • Show All 2,289 Lines • Show Last 20 Lines |