c++ base64 编码
#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; }
桂棹兮兰桨,击空明兮溯流光。