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

Function hex_encode

cpp/testapps/cppWindowsRunnerGame/main.cpp:213–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213std::string hex_encode(unsigned char* data, size_t len)
214{
215 std::stringstream ss;
216 ss << std::hex << std::setfill('0');
217 for (size_t i = 0; i < len; i++)
218 {
219 // Cast data[i] to an int so that it uses the int-based overload of the << operator.
220 // If it uses the char-based overload then it's going to treat data[i] as a printable character.
221 // See: [https://arstechnica.com/civis/viewtopic.php?t=796634](https://arstechnica.com/civis/viewtopic.php?t=796634)
222 ss << std::setw(2) << static_cast<unsigned int>(data[i]);
223 }
224 return ss.str();
225}
226
227bool DoesCertificateExist(std::string expectedThumbprint)
228{

Callers 1

DoesCertificateExistFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected