5 char s64table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
14 pcharmap= charmap + 1;
16 for (i = 0; i <= 255; i++)
17 pcharmap[i] = UNDEF_CH;
19 for (i = 0; i < 64; i++) {
21 if (pcharmap[ch] == UNDEF_CH)
26 int b64decode(char *s, char *dest)
33 if ((*s=='=') || ((k=pcharmap[(unsigned char) (*(s++))])<0))
\r
37 if ((*s=='=') || ((k2=pcharmap[(unsigned char) (*(s++))])<0))
\r
40 dest[i++] = (k<<2) + (k2>>4);
\r
46 if ((k=pcharmap[(unsigned char) (*(s++))])<0)
\r
49 dest[i++] = (k2<<4) + (k>>2);
\r
55 if ((k2=pcharmap[(unsigned char) (*(s++))])<0)
\r
58 dest[i++] = (k<<6) + (k2);
\r