| 24 | // From: http://stackoverflow.com/a/28471421 |
| 25 | |
| 26 | std::string Decode(std::string const & val) |
| 27 | { |
| 28 | using namespace boost::archive::iterators; |
| 29 | using It = transform_width<binary_from_base64<std::string::const_iterator>, 8, 6>; |
| 30 | return boost::algorithm::trim_right_copy_if(std::string(It(std::begin(val)), It(std::end(val))), |
| 31 | [](char c) { return c == '\0'; }); |
| 32 | } |
| 33 | |
| 34 | std::string Encode(std::string_view val) |
| 35 | { |