out should be appropriately sized */
| 593 | |
| 594 | /* out should be appropriately sized */ |
| 595 | void 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 | } |
no outgoing calls
no test coverage detected