MCPcopy Create free account
hub / github.com/PlayFab/gsdk / hex_encode

Function hex_encode

cpp/testapps/cppLinuxRunnerGame/main.cpp:185–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185std::string hex_encode(unsigned char* data, size_t len)
186{
187 std::stringstream ss;
188 ss << std::hex << std::setfill('0');
189 for (size_t i = 0; i < len; i++)
190 {
191 // Cast data[i] to an int so that it uses the int-based overload of the << operator.
192 // If it uses the char-based overload then it's going to treat data[i] as a printable character.
193 // See: [https://arstechnica.com/civis/viewtopic.php?t=796634](https://arstechnica.com/civis/viewtopic.php?t=796634)
194 ss << std::setw(2) << static_cast<unsigned int>(data[i]);
195 }
196 return ss.str();
197}
198
199void getTestCert()
200{

Callers 1

getTestCertFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected