From 2e1ddeb6547e140e9651231fedcd00e8ee4b1ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Sun, 14 Jun 2020 22:54:42 +0200 Subject: Implement SASL plain authentication --- src/utils/base64.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/utils/base64.cpp (limited to 'src/utils/base64.cpp') diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp new file mode 100644 index 0000000..350e2db --- /dev/null +++ b/src/utils/base64.cpp @@ -0,0 +1,19 @@ +#include + +#ifdef BOTAN_FOUND +#include +#endif + +namespace base64 +{ + +std::string encode(const std::string &input) +{ +#ifdef BOTAN_FOUND + return Botan::base64_encode(reinterpret_cast(input.data()), input.size()); +#else +#error "base64::encode() not yet implemented without Botan." +#endif +} + +} -- cgit v1.2.3