2018-07-06 01:20:51 +01:00
|
|
|
// converts src[0:slen] to base64 string
|
|
|
|
char *base64_to(char *dst,const u8 *src,size_t slen);
|
|
|
|
// calculates length needed to store data converted to base64
|
2019-03-15 21:04:40 +00:00
|
|
|
#define BASE64_TO_LEN(l) ((((l) + 2) / 3) * 4)
|
2018-07-06 01:20:51 +01:00
|
|
|
// converts src string from base64
|
|
|
|
size_t base64_from(u8 *dst,const char *src,size_t slen);
|
2018-07-12 12:35:39 +00:00
|
|
|
// calculates length needed to store data converted from base64
|
2018-07-06 01:20:51 +01:00
|
|
|
#define BASE64_FROM_LEN(l) ((l) / 4 * 3)
|
2019-03-16 21:57:29 +02:00
|
|
|
// validates base64 string and optionally stores length of valid data
|
2018-07-06 01:20:51 +01:00
|
|
|
// returns 1 if whole string is good, 0 if string contains invalid data
|
|
|
|
int base64_valid(const char *src,size_t *count);
|
2018-07-12 12:58:42 +00:00
|
|
|
// aligns data length to something base64 can represent without padding
|
2018-07-12 13:05:53 +00:00
|
|
|
#define BASE64_DATA_ALIGN(l) ((((l) + 2) / 3) * 3)
|