The standard 'base64url' with URL and Filename Safe Alphabet described in RFC 4648
#include "b64.h"
int b64_encode(const uint8_t *in, size_t ilen, char *out, size_t *olen);
int b64_decode(const char *in, size_t ilen, uint8_t *out, size_t *olen);
int urlsafe_b64_encode(const uint8_t *in, size_t ilen, char *out, size_t *olen);
int urlsafe_b64_decode(const char *in, size_t ilen, uint8_t *out, size_t *olen);