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

Function SanitizeString

src/utilstrencodings.cpp:17–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15using namespace std;
16
17string SanitizeString(const string& str)
18{
19 /**
20 * safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything
21 * even possibly remotely dangerous like & or >
22 */
23 static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@()");
24 string strResult;
25 for (std::string::size_type i = 0; i < str.size(); i++)
26 {
27 if (safeChars.find(str[i]) != std::string::npos)
28 strResult.push_back(str[i]);
29 }
30 return strResult;
31}
32
33const signed char p_util_hexdigit[256] =
34{ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,

Callers 7

parseMethod · 0.85
ParseIPDataFunction · 0.85
AlertNotifyFunction · 0.85
SanityCheckMessageFunction · 0.85
ProcessMessageFunction · 0.85
ProcessMessagesFunction · 0.85
EXCLUSIVE_LOCK_FUNCTIONFunction · 0.85

Calls 3

findMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected