Crypto++
base32.h
1 #ifndef CRYPTOPP_BASE32_H
2 #define CRYPTOPP_BASE32_H
3 
4 #include "basecode.h"
5 
6 NAMESPACE_BEGIN(CryptoPP)
7 
8 //! Converts given data to base 32, the default code is based on draft-ietf-idn-dude-02.txt
9 /*! To specify alternative code, call Initialize() with EncodingLookupArray parameter. */
11 {
12 public:
13  Base32Encoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int outputGroupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
14  : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
15  {
16  IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), outputGroupSize)(Name::Separator(), ConstByteArrayParameter(separator)));
17  }
18 
19  void IsolatedInitialize(const NameValuePairs &parameters);
20 };
21 
22 //! Decode base 32 data back to bytes, the default code is based on draft-ietf-idn-dude-02.txt
23 /*! To specify alternative code, call Initialize() with DecodingLookupArray parameter. */
25 {
26 public:
27  Base32Decoder(BufferedTransformation *attachment = NULL)
28  : BaseN_Decoder(GetDefaultDecodingLookupArray(), 5, attachment) {}
29 
30  void IsolatedInitialize(const NameValuePairs &parameters);
31 
32 private:
33  static const int * CRYPTOPP_API GetDefaultDecodingLookupArray();
34 };
35 
36 NAMESPACE_END
37 
38 #endif
used to pass byte array input as part of a NameValuePairs object
Definition: algparam.h:13
Converts given data to base 32, the default code is based on draft-ietf-idn-dude-02.txt.
Definition: base32.h:10
interface for buffered transformations
Definition: cryptlib.h:770
simple proxy filter that doesn't modify the underlying filter's input or output
Definition: filters.h:555
filter that breaks input stream into groups of fixed size
Definition: basecode.h:62
Decode base 32 data back to bytes, the default code is based on draft-ietf-idn-dude-02.txt.
Definition: base32.h:24
base n encoder, where n is a power of 2
Definition: basecode.h:11
base n decoder, where n is a power of 2
Definition: basecode.h:37
interface for retrieving values given their names
Definition: cryptlib.h:224