Fabcoin Core  0.16.2
P2P Digital Currency
hex.h
Go to the documentation of this file.
1 // hex.h - written and placed in the public domain by Wei Dai
2 
5 
6 #ifndef CRYPTOPP_HEX_H
7 #define CRYPTOPP_HEX_H
8 
9 #include "cryptlib.h"
10 #include "basecode.h"
11 
13 
17 {
18 public:
25  HexEncoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
26  : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
27  {
28  IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
29  }
30 
31  void IsolatedInitialize(const NameValuePairs &parameters);
32 };
33 
37 {
38 public:
41  HexDecoder(BufferedTransformation *attachment = NULL)
42  : BaseN_Decoder(GetDefaultDecodingLookupArray(), 4, attachment) {}
43 
45 
46 private:
47  static const int * CRYPTOPP_API GetDefaultDecodingLookupArray();
48 };
49 
51 
52 #endif
Used to pass byte array input as part of a NameValuePairs object.
Definition: algparam.h:29
Converts given data to base 16.
Definition: hex.h:16
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
Decode base 16 data back to bytes.
Definition: hex.h:36
Abstract base classes that provide a uniform interface to this library.
Interface for buffered transformations.
Definition: cryptlib.h:1352
HexEncoder(BufferedTransformation *attachment=NULL, bool uppercase=true, int groupSize=0, const std::string &separator=":", const std::string &terminator="")
Construct a HexEncoder.
Definition: hex.h:25
void IsolatedInitialize(const NameValuePairs &parameters)
Initialize or reinitialize this object, without signal propagation.
Definition: basecode.cpp:115
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
HexDecoder(BufferedTransformation *attachment=NULL)
Construct a HexDecoder.
Definition: hex.h:41
#define CRYPTOPP_API
Definition: config.h:705
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
Encoder for bases that are a power of 2.
Definition: basecode.h:18
#define CRYPTOPP_DLL
Definition: config.h:704
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