summaryrefslogtreecommitdiff
path: root/src/mongo/util/base64.h
diff options
context:
space:
mode:
authorVarun Ravichandran <varun.ravichandran@mongodb.com>2022-08-23 15:43:11 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-23 23:45:45 +0000
commitb97bcd00e8b8b4ebf3988feb6eea288b705bf00c (patch)
tree468249083fbeec68321fac3acb173e21250ef05f /src/mongo/util/base64.h
parentec2724c6a4cb6582d710f450714398c8bd6a70fb (diff)
downloadmongo-b97bcd00e8b8b4ebf3988feb6eea288b705bf00c.tar.gz
Revert "SERVER-67464 Add base64url encode/decode"
This reverts commit ef8c3a1546b72894360dab8e3121434ba306c884.
Diffstat (limited to 'src/mongo/util/base64.h')
-rw-r--r--src/mongo/util/base64.h31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/mongo/util/base64.h b/src/mongo/util/base64.h
index 28ef7a553f7..7a2627338d2 100644
--- a/src/mongo/util/base64.h
+++ b/src/mongo/util/base64.h
@@ -35,8 +35,7 @@
#include "mongo/base/string_data.h"
-namespace mongo {
-namespace base64 {
+namespace mongo::base64 {
std::string encode(StringData in);
std::string decode(StringData in);
@@ -60,31 +59,5 @@ bool validate(StringData s);
constexpr std::size_t encodedLength(std::size_t inLen) {
return (inLen + 2) / 3 * 4;
}
-} // namespace base64
-// base64url encoding is a "url safe" variant of base64.
-// '+' is replaced with '-'
-// '/' is replaced with '_'
-// '=' at the end of the string are optional
-namespace base64url {
-
-std::string encode(StringData in);
-std::string decode(StringData out);
-
-void encode(std::stringstream& ss, StringData in);
-void decode(std::stringstream& ss, StringData in);
-
-void encode(fmt::memory_buffer& buffer, StringData in);
-void decode(fmt::memory_buffer& buffer, StringData in);
-
-inline std::string encode(const void* data, std::size_t len) {
- return encode(StringData(reinterpret_cast<const char*>(data), len));
-}
-
-bool validate(StringData s);
-
-constexpr std::size_t encodedLength(std::size_t inLen) {
- return base64::encodedLength(inLen);
-}
-} // namespace base64url
-} // namespace mongo
+} // namespace mongo::base64