Fabcoin Core  0.16.2
P2P Digital Currency
base64.h
Go to the documentation of this file.
1 // base64.h - written and placed in the public domain by Wei Dai
2 
5 
6 #ifndef CRYPTOPP_BASE64_H
7 #define CRYPTOPP_BASE64_H
8 
9 #include "cryptlib.h"
10 #include "basecode.h"
11 
13 
14 class Base64Encoder : public SimpleProxyFilter
18 {
19 public:
27  Base64Encoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = true, int maxLineLength = 72)
28  : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
29  {
30  IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength));
31  }
32 
53  void IsolatedInitialize(const NameValuePairs &parameters);
54 };
55 
60 {
61 public:
66  : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
67 
86 
87 private:
90  static const int * CRYPTOPP_API GetDecodingLookupArray();
91 };
92 
98 {
99 public:
112  Base64URLEncoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = false, int maxLineLength = -1)
113  : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
114  {
115  CRYPTOPP_UNUSED(insertLineBreaks), CRYPTOPP_UNUSED(maxLineLength);
116  IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), false)(Name::MaxLineLength(), -1)(Name::Pad(),false));
117  }
118 
129 };
130 
136 {
137 public:
143  : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
144 
153 
154 private:
157  static const int * CRYPTOPP_API GetDecodingLookupArray();
158 };
159 
161 
162 #endif
Base64URLEncoder(BufferedTransformation *attachment=NULL, bool insertLineBreaks=false, int maxLineLength=-1)
Construct a Base64URLEncoder.
Definition: base64.h:112
Base64 decodes data using a web safe alphabet.
Definition: base64.h:135
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
Base64 decodes data.
Definition: base64.h:59
Abstract base classes that provide a uniform interface to this library.
Base64 encodes data using a web safe alphabet.
Definition: base64.h:97
Interface for buffered transformations.
Definition: cryptlib.h:1352
Base64 encodes data.
Definition: base64.h:17
static const int *CRYPTOPP_API GetDecodingLookupArray()
Provides the default decoding lookup table.
Definition: base64.cpp:56
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
#define CRYPTOPP_UNUSED(x)
Definition: config.h:741
Base64URLDecoder(BufferedTransformation *attachment=NULL)
Construct a Base64URLDecoder.
Definition: base64.h:142
Filter that breaks input stream into groups of fixed size.
Definition: basecode.h:110
#define NAMESPACE_END
Definition: config.h:201
std::vector< char * > parameters
Definition: boostTest.cpp:46
void IsolatedInitialize(const NameValuePairs &parameters)
Initialize or reinitialize this object, without signal propagation.
Definition: base64.cpp:49
Encoder for bases that are a power of 2.
Definition: basecode.h:18
Base64Decoder(BufferedTransformation *attachment=NULL)
Construct a Base64Decoder.
Definition: base64.h:65
Base classes for working with encoders and decoders.
Decoder for bases that are a power of 2.
Definition: basecode.h:58
Base64Encoder(BufferedTransformation *attachment=NULL, bool insertLineBreaks=true, int maxLineLength=72)
Construct a Base64Encoder.
Definition: base64.h:27
Interface for retrieving values given their names.
Definition: cryptlib.h:279