mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
util: add functions for printing and parsing hexadecimal data
This commit is contained in:
7
util.h
7
util.h
@@ -205,6 +205,13 @@ extern void UTI_GetRandomBytesUrandom(void *buf, unsigned int len);
|
||||
generating long-term keys */
|
||||
extern void UTI_GetRandomBytes(void *buf, unsigned int len);
|
||||
|
||||
/* Print data in hexadecimal format */
|
||||
extern int UTI_BytesToHex(const void *buf, unsigned int buf_len, char *hex, unsigned int hex_len);
|
||||
|
||||
/* Parse a string containing data in hexadecimal format. In-place conversion
|
||||
is supported. */
|
||||
extern unsigned int UTI_HexToBytes(const char *hex, void *buf, unsigned int len);
|
||||
|
||||
/* Macros to get maximum and minimum of two values */
|
||||
#ifdef MAX
|
||||
#undef MAX
|
||||
|
||||
Reference in New Issue
Block a user