#include <freeradius-devel/util/base16.h>
Go to the source code of this file.
|
| #define | us(x) (uint8_t) x |
| | Encode/decode binary data using printable characters (base16 format - hex)
|
| |
◆ us
◆ 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 144 of file base16.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 115 of file base16.c.
◆ fr_base16_alphabet_decode_mc
Initial value:= {
['0'] = 0,
['1'] = 1,
['2'] = 2,
['3'] = 3,
['4'] = 4,
['5'] = 5,
['6'] = 6,
['7'] = 7,
['8'] = 8,
['9'] = 9,
['A'] = 10,
['B'] = 11,
['C'] = 12,
['D'] = 13,
['E'] = 14,
['F'] = 15,
['a'] = 10,
['b'] = 11,
['c'] = 12,
['d'] = 13,
['e'] = 14,
['f'] = 15,
}
#define F1(_idx, _val)
Fill macros for array initialisation.
Mixed case decode alphabet for base16.
Definition at line 75 of file base16.c.
◆ fr_base16_alphabet_encode_lc
Initial value:= {
[0] = '0',
[1] = '1',
[2] = '2',
[3] = '3',
[4] = '4',
[5] = '5',
[6] = '6',
[7] = '7',
[8] = '8',
[9] = '9',
[10] = 'a',
[11] = 'b',
[12] = 'c',
[13] = 'd',
[14] = 'e',
[15] = 'f'
}
lower case encode alphabet for base16
Encode/decode binary data using printable characters (base16 format - hex)
Definition at line 31 of file base16.c.
◆ fr_base16_alphabet_encode_uc
Initial value:= {
[0] = '0',
[1] = '1',
[2] = '2',
[3] = '3',
[4] = '4',
[5] = '5',
[6] = '6',
[7] = '7',
[8] = '8',
[9] = '9',
[10] = 'A',
[11] = 'B',
[12] = 'C',
[13] = 'D',
[14] = 'E',
[15] = 'F'
}
lower case encode alphabet for base16
Definition at line 53 of file base16.c.