Add base64_encode() to utils

This commit is contained in:
2022-08-17 12:57:07 +02:00
parent 0648c75baa
commit ee8aedce91
2 changed files with 27 additions and 0 deletions

View File

@@ -20,6 +20,10 @@
extern char *log_prefix;
static const char base64_encode_table[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static const int base64_mod_table[3] = {0, 2, 1};
#define out_1(fmt) fprintf(stdout, "%s" fmt "\n", log_prefix)
#define out_2(fmt, args...) fprintf(stdout, "%s" fmt "\n", log_prefix, args)
@@ -46,4 +50,6 @@ int str_trim(char **start, char **end);
int str_trim_lws(char **start, char **end);
int base64_encode(void *data, unsigned long data_len, char *output, unsigned long *output_len);
#endif //NECRONDA_SERVER_UTILS_H