MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / string_to_hex

Function string_to_hex

core/cube/cube-api/src/cube_cli.cpp:49–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47namespace rec {
48namespace mcube {
49std::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
63int run(int argc, char** argv, int thread_id) {
64 google::ParseCommandLineFlags(&argc, &argv, true);

Callers 1

runFunction · 0.70

Calls 2

lengthMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected