Fabcoin Core  0.16.2
P2P Digital Currency
base32.h
Go to the documentation of this file.
1 // base32.h - written and placed in the public domain by Frank Palazzolo, based on hex.cpp by Wei Dai
2 
5 
6 #ifndef CRYPTOPP_BASE32_H
7 #define CRYPTOPP_BASE32_H
8 
9 #include "cryptlib.h"
10 #include "basecode.h"
11 
13 
14 class Base32Encoder : public SimpleProxyFilter
18 {
19 public:
29  Base32Encoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
30  : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
31  {
32  IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
33  }
34 
55  void IsolatedInitialize(const NameValuePairs &parameters);
56 };
57 
62 {
63 public:
68  : BaseN_Decoder(GetDefaultDecodingLookupArray(), 5, attachment) {}
69 
87 
88 private:
91  static const int * CRYPTOPP_API GetDefaultDecodingLookupArray();
92 };
93 
95 
96 #endif
Used to pass byte array input as part of a NameValuePairs object.
Definition: algparam.h:29
Base32 encodes data.
Definition: base32.h:17
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
Abstract base classes that provide a uniform interface to this library.
static const int *CRYPTOPP_API GetDefaultDecodingLookupArray()
Provides the default decoding lookup table.
Definition: base32.cpp:29
Interface for buffered transformations.
Definition: cryptlib.h:1352
Base32Encoder(BufferedTransformation *attachment=NULL, bool uppercase=true, int groupSize=0, const std::string &separator=":", const std::string &terminator="")
Construct a Base32Encoder.
Definition: base32.h:29
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
Definition: algparam.h:498
Proxy filter that doesn't modify the underlying filter's input or output.
Definition: filters.h:977
#define CRYPTOPP_API
Definition: config.h:705
void IsolatedInitialize(const NameValuePairs &parameters)
Initialize or reinitialize this object, without signal propagation.
Definition: base32.cpp:22
Base32Decoder(BufferedTransformation *attachment=NULL)
Construct a Base32Decoder.
Definition: base32.h:67
Filter that breaks input stream into groups of fixed size.
Definition: basecode.h:110
#define NAMESPACE_END
Definition: config.h:201
Base32 decodes data.
Definition: base32.h:61
std::vector< char * > parameters
Definition: boostTest.cpp:46
Encoder for bases that are a power of 2.
Definition: basecode.h:18
Base classes for working with encoders and decoders.
Decoder for bases that are a power of 2.
Definition: basecode.h:58
Interface for retrieving values given their names.
Definition: cryptlib.h:279