18 static char encoding[] =
19 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
41 n = (buf[0] << 16) + (buf[1] << 8) + buf[2];
44 *out++ = encoding[(n >> 18) & 63];
45 *out++ = encoding[(n >> 12) & 63];
47 *out++ = encoding[(n >> 6) & 63];
48 if (in[1] != 0 && in[2] != 0)
49 *out++ = encoding[n & 63];
63 const char *map =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
64 "abcdefghijklmnopqrstuvwxyz0123456789+/";
66 while (*len > 0 && strchr(
"\r\n\t\f ", **in))
71 if (*len > 0 && **in ==
'=')
73 if (*len > 0 && (p = strchr(map, **in)))
84 size_t len = strlen(in);
96 *(out++) = i0 << 2 | i1 >> 4;
102 *(out++) = i1 << 4 | i2 >> 2;
108 *(out++) = i2 << 6 | i3;
int yaz_base64decode(const char *in, char *out)
decodes Base64 string
static int next_char(const char **in, size_t *len)
void yaz_base64encode(const char *in, char *out)
encodes Base64 string
Header for Base64 utilities.