| 11 | { |
| 12 | |
| 13 | std::string base64Encode(const std::string & decoded, bool url_encoding, bool no_padding) |
| 14 | { |
| 15 | std::ostringstream ostr; // STYLE_CHECK_ALLOW_STD_STRING_STREAM |
| 16 | ostr.exceptions(std::ios::failbit); |
| 17 | auto options = (url_encoding ? Poco::BASE64_URL_ENCODING : 0) |
| 18 | | (no_padding ? Poco::BASE64_NO_PADDING : 0); |
| 19 | Poco::Base64Encoder encoder(ostr, options); |
| 20 | encoder.rdbuf()->setLineLength(0); |
| 21 | encoder << decoded; |
| 22 | encoder.close(); |
| 23 | return ostr.str(); |
| 24 | } |
| 25 | |
| 26 | std::string base64Decode(const std::string & encoded, bool url_encoding, bool no_padding) |
| 27 | { |
no test coverage detected