24RCSIDH(base16_h,
"$Id: f5638f80ae3ead4db3055e61fa89c98b04797b6f $")
30#include <freeradius-devel/missing.h>
31#include <freeradius-devel/util/sbuff.h>
32#include <freeradius-devel/util/dbuff.h>
53 return alphabet[(
uint8_t)c] < 16;
57#define fr_base16_encode(_out, _in) \
58 fr_base16_encode_nstd(_out, _in, fr_base16_alphabet_encode_lc)
77 fr_sbuff_init_talloc(ctx, &sbuff, &tctx,
95#define fr_base16_decode(_err, _out, _in, _no_trailing) \
96 fr_base16_decode_nstd(_err, _out, _in, _no_trailing, fr_base16_alphabet_decode_mc)
static fr_slen_t fr_base16_aencode(TALLOC_CTX *ctx, char **out, fr_dbuff_t *in)
Convert binary data to a hex string, allocating the output buffer.
char const fr_base16_alphabet_encode_lc[UINT8_MAX+1]
Encode/decode binary data using printable characters (base16 format - hex)
#define fr_base16_encode(_out, _in)
static bool fr_is_base16_nstd(char c, uint8_t const alphabet[static UINT8_MAX+1])
Check if char is in base16 alphabet.
fr_slen_t fr_base16_encode_nstd(fr_sbuff_t *out, fr_dbuff_t *in, char const alphabet[static UINT8_MAX+1])
Convert binary data to a hex string.
char const fr_base16_alphabet_encode_uc[UINT8_MAX+1]
lower case encode alphabet for base16
fr_slen_t fr_base16_decode_nstd(fr_sbuff_parse_error_t *err, fr_dbuff_t *out, fr_sbuff_t *in, bool no_trailing, uint8_t const alphabet[static UINT8_MAX+1])
Decode base16 encoded input.
uint8_t const fr_base16_alphabet_decode_mc[UINT8_MAX+1]
Mixed case decode alphabet for base16.
#define fr_dbuff_remaining(_dbuff_or_marker)
Return the number of bytes remaining between the dbuff or marker and the end of the buffer.
int fr_sbuff_trim_talloc(fr_sbuff_t *sbuff, size_t len)
Trim a talloced sbuff to the minimum length required to represent the contained string.
Talloc sbuff extension structure.
static size_t char ** out