|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
Tiny no-stdlib hex encode / decode / nibble helpers (one shared copy). More...
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Functions | |
| char | det_hex_digit (int nibble, bool upper=false) |
Nibble 0..15 -> hex char (lowercase, or uppercase when upper). | |
| int | det_hex_val (char c) |
Hex digit -> 0..15, or -1 if c is not a hex digit (either case). | |
| void | det_hex_encode (const uint8_t *in, size_t n, char *out, bool upper=false) |
Encode n bytes as 2*n hex chars + NUL into out (needs cap >= 2*n+1). | |
| int | det_hex_decode (const char *in, size_t hexlen, uint8_t *out, size_t out_cap) |
Decode exactly hexlen hex chars into out (hexlen/2 bytes). | |
Tiny no-stdlib hex encode / decode / nibble helpers (one shared copy).
Hex was open-coded in ~10 places (CSRF token, WebDAV XX, provisioning, audit-log hash, device-id, HTTP auth, OAuth2 percent-encode). These header-only inline helpers are the single home for it, mirroring numparse.h - no <stdlib.h>, no heap, and zero link cost when unused.
Definition in file hex.h.
|
inline |
|
inline |
Hex digit -> 0..15, or -1 if c is not a hex digit (either case).
Definition at line 31 of file hex.h.
Referenced by det_hex_decode(), and detws_prov_form_field().
|
inline |
|
inline |
Decode exactly hexlen hex chars into out (hexlen/2 bytes).
out_cap) / non-hex input. Definition at line 61 of file hex.h.
References det_hex_val().