#include <iostream> #include <string> #include <vector> #include <cryptopp/base64.h> #include <cryptopp/filters.h> std::string BinaryToBase64(const std::vector<unsigned char>& data) { std::string encoded; CryptoPP::StringSource source(data.data(), data.size(), true, new CryptoPP::Base64Encoder( new CryptoPP::StringSink(encoded), false // do not append a newline ) ); return encoded; }
标签:std,编码,CryptoPP,base64,c++,encoded,include,data From: https://www.cnblogs.com/nanfei/p/17426519.html