45 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
57 const unsigned char *q;
63 p = s = (
char *) malloc(size * 4 / 3 + 4);
68 q = (
const unsigned char *) data;
70 for (i = 0; i < size; )
118 #define DECODE_ERROR 0xffffffff
124 unsigned int val = 0;
126 if (!token[0] || !token[1] || !token[2] || !token[3])
130 for (i = 0; i < 4; i++)
143 val +=
pos(token[i]);
150 return (marker << 24) | val;
162 unsigned char *e = NULL;
169 for (p = str; *p && (*p ==
'=' || strchr(
base64_chars, *p)); p += 4)
172 unsigned int marker = (val >> 24) & 0xff;
181 *q++ = (val >> 16) & 0xff;
188 *q++ = (val >> 8) & 0xff;
199 return q - (
unsigned char *) data;