1
// base32.cpp - written and placed in the public domain by Frank Palazzolo, based on hex.cpp by Wei Dai
6
NAMESPACE_BEGIN(CryptoPP)
8
static const byte s_vecUpper[] = "ABCDEFGHIJKMNPQRSTUVWXYZ23456789";
9
static const byte s_vecLower[] = "abcdefghijkmnpqrstuvwxyz23456789";
11
void Base32Encoder::IsolatedInitialize(const NameValuePairs ¶meters)
13
bool uppercase = parameters.GetValueWithDefault(Name::Uppercase(), true);
14
m_filter->Initialize(CombinedNameValuePairs(
16
MakeParameters(Name::EncodingLookupArray(), uppercase ? &s_vecUpper[0] : &s_vecLower[0], false)(Name::Log2Base(), 5, true)));
19
void Base32Decoder::IsolatedInitialize(const NameValuePairs ¶meters)
21
BaseN_Decoder::Initialize(CombinedNameValuePairs(
23
MakeParameters(Name::DecodingLookupArray(), GetDefaultDecodingLookupArray(), false)(Name::Log2Base(), 5, true)));
26
const int *Base32Decoder::GetDefaultDecodingLookupArray()
28
static volatile bool s_initialized = false;
29
static int s_array[256];
33
InitializeDecodingLookupArray(s_array, s_vecUpper, 32, true);