| 47 | namespace rec { |
| 48 | namespace mcube { |
| 49 | std::string string_to_hex(const std::string& input) { |
| 50 | static const char* const lut = "0123456789ABCDEF"; |
| 51 | size_t len = input.length(); |
| 52 | |
| 53 | std::string output; |
| 54 | output.reserve(2 * len); |
| 55 | for (size_t i = 0; i < len; ++i) { |
| 56 | const unsigned char c = input[i]; |
| 57 | output.push_back(lut[c >> 4]); |
| 58 | output.push_back(lut[c & 15]); |
| 59 | } |
| 60 | return output; |
| 61 | } |
| 62 | |
| 63 | int run(int argc, char** argv, int thread_id) { |
| 64 | google::ParseCommandLineFlags(&argc, &argv, true); |