Browse Source

[core] li_base64_dec()

(make public in base64.h, like li_base64_enc())
master
Glenn Strauss 4 months ago
parent
commit
396a923066
  1. 2
      src/base64.c
  2. 2
      src/base64.h

2
src/base64.c

@ -37,7 +37,7 @@ static const signed char base64_url_reverse_table[] = {
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, /* 0x70 - 0x7F */
};
static size_t li_base64_dec(unsigned char * const result, const size_t out_length, const char * const in, const size_t in_length, const base64_charset charset) {
size_t li_base64_dec(unsigned char * const result, const size_t out_length, const char * const in, const size_t in_length, const base64_charset charset) {
size_t i;
const signed char * const base64_reverse_table = (charset)
? base64_url_reverse_table /* BASE64_URL */

2
src/base64.h

@ -9,6 +9,8 @@ typedef enum {
BASE64_URL,
} base64_charset;
size_t li_base64_dec(unsigned char *result, size_t out_length, const char *in, size_t in_length, base64_charset charset);
unsigned char* buffer_append_base64_decode(buffer *out, const char* in, size_t in_length, base64_charset charset);
size_t li_base64_enc(char* restrict out, size_t out_length, const unsigned char* restrict in, size_t in_length, base64_charset charset, int pad);

Loading…
Cancel
Save