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];