/* ============================================================================= * hexutil.c * ===========================================================================*/ #include "hexutil.h" void hex_encode_lower(const uint8_t *in, size_t len, char *out) { static const char digits[] = "0123456789abcdef"; for (size_t i = 0; i < len; i++) { out[i * 2 + 0] = digits[(in[i] >> 4) & 0x0F]; out[i * 2 + 1] = digits[in[i] & 0x0F]; } out[len * 2] = '\0'; }