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

Function luabb_fromhex

lua/luautil.c:595–605  ·  view source on GitHub ↗

out should be appropriately sized */

Source from the content-addressed store, hash-verified

593
594/* out should be appropriately sized */
595void luabb_fromhex(uint8_t *out, const uint8_t *in, size_t len)
596{
597 const uint8_t *end = in + len;
598 while (in != end) {
599 uint8_t i0 = tolower(*(in++));
600 uint8_t i1 = tolower(*(in++));
601 i0 -= isdigit(i0) ? '0' : ('a' - 0xa);
602 i1 -= isdigit(i1) ? '0' : ('a' - 0xa);
603 *(out++) = (i0 << 4) | i1;
604 }
605}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected