3 * @author David Llewellyn-Jones <david@flypig.co.uk>
8 * Copyright David Llewellyn-Jones, 2020
9 * Released under the GPLv2.
11 * @brief Static utility functions
12 * @section DESCRIPTION
14 * Provides various static utitlity functions. In particular:
16 * base64 encoding and decoding functionality.
17 * Time conversion: from epoch to day numbers and time interval numbers.
35 ({ __typeof__ (a) _a = (a); \
36 __typeof__ (b) _b = (b); \
40 ({ __typeof__ (a) _a = (a); \
41 __typeof__ (b) _b = (b); \
46 // Function prototypes
48 size_t base64_encode_size(size_t binary_input
);
49 size_t base64_decode_size(size_t base64_input
);
50 void base64_encode_binary_to_base64(unsigned char const *input
, size_t input_size
, unsigned char *output
, size_t *output_size
);
51 void base64_decode_base64_to_binary(unsigned char const *input
, size_t input_size
, unsigned char *output
, size_t *output_size
);
53 uint32_t epoch_to_day_number(time_t epoch
);
54 uint8_t epoch_to_time_interval_number(time_t epoch
);
56 // Function definitions
60 /** @} addtogroup Utils */