Lines Matching defs:b64
202 * b64: buffer holding the encoded (base64) source.
203 * cnt: number of bytes in the b64 buffer to decode (see note 2).
210 * 2) The b64 buffer should always contain a multiple of 4 bytes of
214 mime_b64tobin(char *bin, const char *b64, size_t cnt)
234 q = (const unsigned char *)b64;
268 * b64: buffer to hold the encoded (base64) result (see note).
272 * NOTE: it is the callers responsibility to ensure that 'b64' is
276 mime_bintob64(char *b64, const char *bin, size_t cnt)
288 b64[0] = b64table[a >> 2];
291 b64[1] = b64table[((a & 0x3) << 4)];
292 b64[2] = '=';
293 b64[3] = '=';
296 b64[1] = b64table[((a & 0x3) << 4) | ((b & 0xf0) >> 4)];
297 b64[2] = b64table[((b & 0xf) << 2)];
298 b64[3] = '=';
301 b64[1] = b64table[((a & 0x3) << 4) | ((b & 0xf0) >> 4)];
302 b64[2] = b64table[((b & 0xf) << 2) | ((c & 0xc0) >> 6)];
303 b64[3] = b64table[c & 0x3f];
307 b64 += 4;
317 static char b64[MIME_BASE64_LINE_MAX];
328 if (limit == 0 || limit > sizeof(b64))
329 limit = sizeof(b64);
336 mime_bintob64(b64, mem, (size_t)cnt);
337 (void)fwrite(b64, sizeof(*b64), (size_t)4 * roundup(cnt, 3) / 3, fo);