来自 BASE64CODER文档, ,构造函数的签名是
Base64Encoder (BufferedTransformation *attachment=NULL, bool insertLineBreaks=true, int maxLineLength=72)
因此,默认情况下,您会在编码字符串中获得断路。为了避免这种情况,只需做:
CryptoPP::StringSource ss(
in,
true,
new CryptoPP::Base64Encoder(
new CryptoPP::StringSink(encoded),
false
)
);