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

Function fromHex

lib/cipher.cpp:62–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62std::string fromHex(const std::string& hex) {
63 if (hex.size() % 2 != 0) throw std::runtime_error("Invalid hex length");
64 std::string result;
65 for (size_t i = 0; i < hex.size(); i += 2) {
66 result += (char)std::stoi(hex.substr(i, 2), nullptr, 16);
67 }
68 return result;
69}
70
71int main(int argc, char* argv[]) {
72 if (argc < 4) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected