A simple base64 codec(encoder & decoder)
uc::Base64Encoder encoder;
char buf[4096]; // binary data
// ...
std::string base64_text;
// false indicates don't put newline character every 64 bytes
encoder.Encode(buf, sizeof buf, base64_text, false);
uc::Base64Decoder decoder;
char base64_buf[4096]; // base64 encoding data
// ...
std::vector<unsigned char> binary_data;
decoder.Decode(base64_buf, sizeof buf, binary_data, false);
More detail please see the base64_*.*