summaryrefslogtreecommitdiff
path: root/src/utils/base64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/base64.cpp')
-rw-r--r--src/utils/base64.cpp19
1 files changed, 19 insertions, 0 deletions
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 <utils/base64.hpp>
+
+#ifdef BOTAN_FOUND
+#include <botan/base64.h>
+#endif
+
+namespace base64
+{
+
+std::string encode(const std::string &input)
+{
+#ifdef BOTAN_FOUND
+ return Botan::base64_encode(reinterpret_cast<const uint8_t*>(input.data()), input.size());
+#else
+#error "base64::encode() not yet implemented without Botan."
+#endif
+}
+
+}