MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / fromhex

Function fromhex

tools/cdb2sql/cdb2sql.cpp:636–649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

634}
635
636int fromhex(uint8_t *out, const uint8_t *in, size_t len)
637{
638 const uint8_t *end = in + len;
639 while (in != end) {
640 uint8_t i0 = tolower(*(in++));
641 uint8_t i1 = tolower(*(in++));
642 if (i0 > 'f' || i1 > 'f')
643 return 1;
644 i0 -= isdigit(i0) ? '0' : ('a' - 0xa);
645 i1 -= isdigit(i1) ? '0' : ('a' - 0xa);
646 *(out++) = (i0 << 4) | i1;
647 }
648 return 0;
649}
650
651const char *cdb2_tp_str[] = {"???",
652 "CDB2_INTEGER",

Callers 1

get_valFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected