MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / toHex

Function toHex

lib/cipher.cpp:55–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55std::string toHex(const std::string& s) {
56 std::ostringstream oss;
57 for (unsigned char c : s)
58 oss << std::hex << std::setw(2) << std::setfill('0') << (int)c;
59 return oss.str();
60}
61
62std::string fromHex(const std::string& hex) {
63 if (hex.size() % 2 != 0) throw std::runtime_error("Invalid hex length");

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected