#include <freeradius-devel/missing.h>
#include <freeradius-devel/util/sbuff.h>
#include <freeradius-devel/util/dbuff.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
Go to the source code of this file.
|
#define | fr_base16_decode(_err, _out, _in, _no_trailing) fr_base16_decode_nstd(_err, _out, _in, _no_trailing, fr_base16_alphabet_decode_mc) |
|
#define | fr_base16_encode(_out, _in) fr_base16_encode_nstd(_out, _in, fr_base16_alphabet_encode_lc) |
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
static bool | fr_is_base16_nstd (char c, uint8_t const alphabet[static UINT8_MAX+1]) |
| Check if char is in base16 alphabet. More...
|
|
◆ fr_base16_decode
◆ fr_base16_encode
◆ fr_base16_aencode()
Convert binary data to a hex string, allocating the output buffer.
Ascii encoded hex string will not be prefixed with '0x'
- Parameters
-
[in] | ctx | to allocate the buffer in. |
[out] | out | where to write the new buffer. |
[in] | in | input. |
- Returns
- >=0 the number of bytes written to out.
- <0 number of bytes we would have needed to print the next hexit.
Definition at line 71 of file base16.h.
◆ fr_base16_decode_nstd()
Decode base16 encoded input.
- Parameters
-
[out] | err | If non-null contains any parse errors. |
[out] | out | Where to write the decoded binary data. |
[in] | in | String to decode. |
[in] | no_trailing | Error out if we find non-base16 characters at the end of the string. |
[in] | alphabet | to use for decoding. |
- Returns
- < 0 on failure. The offset where the decoding error occurred as a negative integer.
- Length of decoded data.
Definition at line 65 of file merged_model.c.
◆ fr_base16_encode_nstd()
Convert binary data to a hex string.
Ascii encoded hex string will not be prefixed with '0x'
- Parameters
-
[out] | out | Output buffer to write to. |
[in] | in | input. |
[in] | alphabet | to use for encode. |
- Returns
- >=0 the number of bytes written to out.
- <0 number of bytes we would have needed to print the next hexit.
Definition at line 56 of file merged_model.c.
◆ fr_is_base16_nstd()
static bool fr_is_base16_nstd |
( |
char |
c, |
|
|
uint8_t const |
alphabet[static UINT8_MAX+1] |
|
) |
| |
|
inlinestatic |
Check if char is in base16 alphabet.
- Parameters
-
[in] | c | char to check. |
[in] | alphabet | to use. |
- Returns
- true if c is a character from the base32 alphabet.
- false if character is not in the base32 alphabet.
Definition at line 51 of file base16.h.
◆ fr_base16_alphabet_decode_mc
Mixed case decode alphabet for base16.
Definition at line 75 of file base16.c.
◆ fr_base16_alphabet_encode_lc
char const fr_base16_alphabet_encode_lc[UINT8_MAX+1] |
|
extern |
◆ fr_base16_alphabet_encode_uc
char const fr_base16_alphabet_encode_uc[UINT8_MAX+1] |
|
extern |
lower case encode alphabet for base16
Definition at line 53 of file base16.c.