|
iPXE
|
Base16 encoding. More...
Go to the source code of this file.
Macros | |
| #define | HEX_DECODE_OPTIONAL 0x80 |
| Treat separator as optional while decoding. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static size_t | base16_encoded_len (size_t raw_len) |
| Calculate length of base16-encoded data. More... | |
| static size_t | base16_decoded_max_len (const char *encoded) |
| Calculate maximum length of base16-decoded string. More... | |
| size_t | hex_encode (char separator, const void *raw, size_t raw_len, char *data, size_t len) |
| Encode hexadecimal string (with optional byte separator character) More... | |
| int | hex_decode (char separator, const char *encoded, void *data, size_t len) |
| Decode hexadecimal string (with optional byte separator character) More... | |
| static | __attribute__ ((always_inline)) size_t base16_encode(const void *raw |
| Base16-encode data. More... | |
Variables | |
| static size_t | raw_len |
| static size_t char * | data |
| static size_t char size_t | len |
Base16 encoding.
Definition in file base16.h.
| #define HEX_DECODE_OPTIONAL 0x80 |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
Calculate length of base16-encoded data.
| raw_len | Raw data length |
| encoded_len | Encoded string length (excluding NUL) |
Definition at line 24 of file base16.h.
References raw_len.
Referenced by base16_encode_okx(), certstat(), ecm_fetch_mac(), http_digest_authenticate(), iscsi_build_login_request_strings(), peerdisc_open(), and peerdist_info_hash_ntoa().
|
inlinestatic |
Calculate maximum length of base16-decoded string.
| encoded | Encoded string |
| max_raw_len | Maximum length of raw data |
Definition at line 34 of file base16.h.
References strlen().
Referenced by base16_decode_okx().
Encode hexadecimal string (with optional byte separator character)
| separator | Byte separator character, or 0 for no separator |
| raw | Raw data |
| raw_len | Length of raw data |
| data | Buffer |
| len | Length of buffer |
| len | Encoded length |
Definition at line 50 of file base16.c.
References bytes, data, len, raw, raw_len, and ssnprintf().
Referenced by format_hex_colon_setting(), format_hex_hyphen_setting(), and format_hex_raw_setting().
| int hex_decode | ( | char | separator, |
| const char * | encoded, | ||
| void * | data, | ||
| size_t | len | ||
| ) |
Decode hexadecimal string (with optional byte separator character)
| separator | Byte separator character, or 0 for no separator |
| encoded | Encoded string |
| data | Buffer |
| len | Length of buffer |
| len | Length of data, or negative error |
Definition at line 76 of file base16.c.
References count, data, digit_value(), EINVAL, HEX_DECODE_OPTIONAL, len, and out.
Referenced by netfront_read_mac(), parse_hex_hyphen_setting(), parse_hex_raw_setting(), parse_hex_setting(), and uuid_aton().
|
inlinestatic |
Base16-encode data.
Base16-decode data.
| raw | Raw data |
| raw_len | Length of raw data |
| data | Buffer |
| len | Length of buffer |
| len | Encoded length |
| encoded | Encoded string |
| data | Buffer |
| len | Length of buffer |
| len | Length of data, or negative error |
| size_t raw_len |
Definition at line 53 of file base16.h.
Referenced by base16_encoded_len(), base64_encode(), base64_encoded_len(), fetchf_setting(), fetchn_setting(), format_base64_setting(), format_busdevfn_setting(), format_dnssl_setting(), format_hex_colon_setting(), format_hex_hyphen_setting(), format_hex_raw_setting(), format_int_setting(), format_ipv4_setting(), format_ipv6_setting(), format_string_setting(), format_uint_setting(), format_uristring_setting(), format_uuid_setting(), hex_encode(), numerate_int_setting(), parse_string_setting(), parse_uri(), pxebs_list(), setting_format(), setting_numerate(), storef_setting(), storen_setting(), and uri_encode().
| void size_t len |
1.8.15