summaryrefslogtreecommitdiffhomepage
path: root/base64.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-04 20:57:15 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-04 20:57:15 +0100
commit9d00f7319eda30ec91637a75b3fddc171e135233 (patch)
tree213fd6694cec8b30aed712837f68bb1aba0e8f89 /base64.cpp
parent8475a181be2301702c409a20dc99115ee54ec9cc (diff)
Adjust to new environment
Diffstat (limited to 'base64.cpp')
-rw-r--r--base64.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/base64.cpp b/base64.cpp
deleted file mode 100644
index 3847f0a..0000000
--- a/base64.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "base64.h"
-
-#include <boost/archive/iterators/binary_from_base64.hpp>
-#include <boost/archive/iterators/base64_from_binary.hpp>
-#include <boost/archive/iterators/transform_width.hpp>
-#include <boost/algorithm/string.hpp>
-
-std::string decode64(const std::string &val)
-{
- using namespace boost::archive::iterators;
- using It = transform_width<binary_from_base64<std::string::const_iterator>, 8, 6>;
- return boost::algorithm::trim_right_copy_if(std::string(It(std::begin(val)), It(std::end(val))), [](char c) {
- return c == '\0';
- });
-}
-
-std::string encode64(const std::string &val)
-{
- using namespace boost::archive::iterators;
- using It = base64_from_binary<transform_width<std::string::const_iterator, 6, 8>>;
- auto tmp = std::string(It(std::begin(val)), It(std::end(val)));
- return tmp.append((3 - val.size() % 3) % 3, '=');
-}