53 const char delimiter[2] = { separator,
'\0' };
59 for ( i = 0 ; i <
raw_len ; i++ ) {
61 "%s%02x", ( used ? delimiter :
"" ),
78 unsigned int count = 0;
79 unsigned int sixteens;
91 if (
count && separator ) {
92 if ( *encoded == separator ) {
94 }
else if ( ! optional ) {
105 if ( sixteens >= 16 )
113 out[
count] = ( ( sixteens << 4 ) | units );
#define EINVAL
Invalid argument.
unsigned int digit_value(unsigned int character)
Calculate digit value.
int ssnprintf(char *buf, ssize_t ssize, const char *fmt,...)
Version of vsnprintf() that accepts a signed buffer size.
#define HEX_DECODE_OPTIONAL
Treat separator as optional while decoding.
uint16_t count
Number of entries.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int hex_decode(char separator, const char *encoded, void *data, size_t len)
Decode hexadecimal string (with optional byte separator character)
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)
uint8_t data[48]
Additional event data.