MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / unhex

Function unhex

lib/core/utils.cc:162–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162std::string unhex(const std::string& s)
163{
164 std::stringstream sin(s);
165 std::stringstream sout;
166
167 for (;;)
168 {
169 int c = sin.get();
170 if (c == -1)
171 break;
172 if (c == '%')
173 {
174 char buf[3];
175 buf[0] = sin.get();
176 buf[1] = sin.get();
177 buf[2] = 0;
178
179 c = std::stoul(buf, nullptr, 16);
180 }
181 sout << (char)c;
182 }
183
184 return sout.str();
185}
186
187std::string tohex(const std::string& s)
188{

Callers 3

getDirentMethod · 0.85
getFileMethod · 0.85
testUnhexFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected