12static inline std::string
hex_encode(
const char *data,
unsigned int data_size)
15 ret.reserve(data_size * 2);
20 for (
unsigned int i = 0; i < data_size; i++) {
21 unsigned char c = (
unsigned char)data[i];
30static inline std::string
hex_encode(std::string_view data)
37 if (hexdigit >=
'0' && hexdigit <=
'9')
38 value = hexdigit -
'0';
39 else if (hexdigit >=
'A' && hexdigit <=
'F')
40 value = hexdigit -
'A' + 10;
41 else if (hexdigit >=
'a' && hexdigit <=
'f')
42 value = hexdigit -
'a' + 10;
static bool hex_digit_decode(char hexdigit, unsigned char &value)
Definition hex.h:35
static std::string hex_encode(const char *data, unsigned int data_size)
Definition hex.h:12
static const char hex_chars[]
Definition hex.h:10