4 #include <Poco/Base64Encoder.h>
5 #include <Poco/Base64Decoder.h>
6 #include <Poco/StreamCopier.h>
12 static std::string encode(
char *b,
size_t blen)
14 std::ostringstream sOut;
15 Poco::Base64Encoder base64(sOut);
16 base64.rdbuf()->setLineLength(0);
17 base64.write(b, blen);
23 static size_t decode(
const std::string &s,
char *b,
size_t bcap)
25 std::istringstream sIn(s);
26 Poco::Base64Decoder base64(sIn);
28 for (
size_t i = 0; i < bcap; ++i) {
31 if (!base64.good() || base64.eof())
38 static std::string decode(
const std::string &s)
40 std::istringstream sIn(s);
41 Poco::Base64Decoder base64(sIn);
44 Poco::StreamCopier::copyToString(base64, result);