20 static const char *b64str
21 =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
22 "abcdefghijklmnopqrstuvwxyz"
27 const unsigned char *in =
static_cast<const unsigned char *
>(bytes);
28 const unsigned char *end = in + nbytes;
31 out << b64str[in[0] >> 2];
32 out << b64str[((in[0] & 0x03) << 4) | (in[1] >> 4)];
33 out << b64str[((in[1] & 0x0f) << 2) | (in[2] >> 6)];
34 out << b64str[in[2] & 0x3f];
39 out << b64str[in[0] >> 2];
42 out << b64str[(in[0] & 0x03) << 4];
47 out << b64str[((in[0] & 0x03) << 4) | (in[1] >> 4)];
48 out << b64str[(in[1] & 0x0f) << 2];
void WriteBase64(std::ostream &out, const void *bytes, size_t nbytes)
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...