~ubuntu-branches/debian/jessie/armory/jessie

« back to all changes in this revision

Viewing changes to cppForSwig/cryptopp/hex.h

  • Committer: Package Import Robot
  • Author(s): Joseph Bisch
  • Date: 2014-10-07 10:22:45 UTC
  • Revision ID: package-import@ubuntu.com-20141007102245-2s3x3rhjxg689hek
Tags: upstream-0.92.3
ImportĀ upstreamĀ versionĀ 0.92.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CRYPTOPP_HEX_H
 
2
#define CRYPTOPP_HEX_H
 
3
 
 
4
#include "basecode.h"
 
5
 
 
6
NAMESPACE_BEGIN(CryptoPP)
 
7
 
 
8
//! Converts given data to base 16
 
9
class CRYPTOPP_DLL HexEncoder : public SimpleProxyFilter
 
10
{
 
11
public:
 
12
        HexEncoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int outputGroupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
 
13
                : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
 
14
        {
 
15
                IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), outputGroupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
 
16
        }
 
17
 
 
18
        void IsolatedInitialize(const NameValuePairs &parameters);
 
19
};
 
20
 
 
21
//! Decode base 16 data back to bytes
 
22
class CRYPTOPP_DLL HexDecoder : public BaseN_Decoder
 
23
{
 
24
public:
 
25
        HexDecoder(BufferedTransformation *attachment = NULL)
 
26
                : BaseN_Decoder(GetDefaultDecodingLookupArray(), 4, attachment) {}
 
27
 
 
28
        void IsolatedInitialize(const NameValuePairs &parameters);
 
29
 
 
30
private:
 
31
        static const int * CRYPTOPP_API GetDefaultDecodingLookupArray();
 
32
};
 
33
 
 
34
NAMESPACE_END
 
35
 
 
36
#endif