| 60 | } |
| 61 | |
| 62 | std::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 | |
| 71 | int main(int argc, char* argv[]) { |
| 72 | if (argc < 4) { |