summaryrefslogtreecommitdiff
path: root/base32.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-11-12 12:37:20 -0500
committerJeffrey Walton <noloader@gmail.com>2017-11-12 12:37:20 -0500
commitf87696b7a5e89e5e98ac7a14cff2e0edeae23197 (patch)
treeb77eefcae84f5528ab34056c52ca582165851963 /base32.cpp
parentbf717f47e6b4ffcf6935a9d5512d5e211d96b59e (diff)
downloadcryptopp-git-f87696b7a5e89e5e98ac7a14cff2e0edeae23197.tar.gz
Cleanup use of unnamed namespaces in encoders and decoders
Diffstat (limited to 'base32.cpp')
-rw-r--r--base32.cpp45
1 files changed, 21 insertions, 24 deletions
diff --git a/base32.cpp b/base32.cpp
index f474de07..c3d32526 100644
--- a/base32.cpp
+++ b/base32.cpp
@@ -4,30 +4,11 @@
#include "base32.h"
NAMESPACE_BEGIN(CryptoPP)
-
-namespace
-{
- const byte s_vecUpper[] = "ABCDEFGHIJKMNPQRSTUVWXYZ23456789";
- const byte s_vecLower[] = "abcdefghijkmnpqrstuvwxyz23456789";
-}
-
-void Base32Encoder::IsolatedInitialize(const NameValuePairs &parameters)
-{
- bool uppercase = parameters.GetValueWithDefault(Name::Uppercase(), true);
- m_filter->Initialize(CombinedNameValuePairs(
- parameters,
- MakeParameters(Name::EncodingLookupArray(), uppercase ? &s_vecUpper[0] : &s_vecLower[0], false)(Name::Log2Base(), 5, true)));
-}
-
-void Base32Decoder::IsolatedInitialize(const NameValuePairs &parameters)
-{
- BaseN_Decoder::IsolatedInitialize(CombinedNameValuePairs(
- parameters,
- MakeParameters(Name::DecodingLookupArray(), GetDefaultDecodingLookupArray(), false)(Name::Log2Base(), 5, true)));
-}
-
ANONYMOUS_NAMESPACE_BEGIN
-static const int s_array[256] = {
+
+const byte s_vecUpper[] = "ABCDEFGHIJKMNPQRSTUVWXYZ23456789";
+const byte s_vecLower[] = "abcdefghijkmnpqrstuvwxyz23456789";
+const int s_array[256] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -45,7 +26,23 @@ static const int s_array[256] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
-NAMESPACE_END
+
+ANONYMOUS_NAMESPACE_END
+
+void Base32Encoder::IsolatedInitialize(const NameValuePairs &parameters)
+{
+ bool uppercase = parameters.GetValueWithDefault(Name::Uppercase(), true);
+ m_filter->Initialize(CombinedNameValuePairs(
+ parameters,
+ MakeParameters(Name::EncodingLookupArray(), uppercase ? &s_vecUpper[0] : &s_vecLower[0], false)(Name::Log2Base(), 5, true)));
+}
+
+void Base32Decoder::IsolatedInitialize(const NameValuePairs &parameters)
+{
+ BaseN_Decoder::IsolatedInitialize(CombinedNameValuePairs(
+ parameters,
+ MakeParameters(Name::DecodingLookupArray(), GetDefaultDecodingLookupArray(), false)(Name::Log2Base(), 5, true)));
+}
// Unrolled initialization, http://github.com/weidai11/cryptopp/issues/376
const int *Base32Decoder::GetDefaultDecodingLookupArray()