MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / SanitizeString

Function SanitizeString

src/commons/util/util.cpp:186–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184// even possibly remotely dangerous like & or >
185static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@");
186string SanitizeString(const string& str) {
187 string strResult;
188 for (string::size_type i = 0; i < str.size(); i++) {
189 if (safeChars.find(str[i]) != string::npos) strResult.push_back(str[i]);
190 }
191 return strResult;
192}
193
194const signed char p_util_hexdigit[256] = {
195 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,

Callers 3

ProcessAlertMethod · 0.50
ProcessVersionMessageFunction · 0.50
ProcessRejectMessageFunction · 0.50

Calls 3

push_backMethod · 0.80
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected