Signed-off-by: Weibing Zhang <zhangweibing@unitedstack.com>
inline std::string to_base64(boost::string_ref sref)
{
using namespace boost::archive::iterators;
- std::string ostr;
-
+
// output must be =padded modulo 3
auto psize = sref.size();
while ((psize % 3) != 0) {
std::string outstr(b64_iter(sref.data()),
b64_iter(sref.data() + sref.size()));
- // pad ostr with '=' to a length that is a multiple of 3
+ // pad outstr with '=' to a length that is a multiple of 3
for (size_t ix = 0; ix < (psize-sref.size()); ++ix)
outstr.push_back('=');