monotone

monotone Mtn Source Tree

Root/cryptopp/hex.h

1#ifndef CRYPTOPP_HEX_H
2#define CRYPTOPP_HEX_H
3
4#include "basecode.h"
5
6NAMESPACE_BEGIN(CryptoPP)
7
8//! Converts given data to base 16
9class HexEncoder : public SimpleProxyFilter
10{
11public:
12HexEncoder(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{
15IsolatedInitialize(MakeParameters("Uppercase", uppercase)("GroupSize", outputGroupSize)("Separator", ConstByteArrayParameter(separator)));
16}
17
18void IsolatedInitialize(const NameValuePairs &parameters);
19};
20
21//! Decode base 16 data back to bytes
22class HexDecoder : public BaseN_Decoder
23{
24public:
25HexDecoder(BufferedTransformation *attachment = NULL)
26: BaseN_Decoder(GetDecodingLookupArray(), 4, attachment) {}
27
28void IsolatedInitialize(const NameValuePairs &parameters) {}
29
30private:
31static const int *GetDecodingLookupArray();
32};
33
34NAMESPACE_END
35
36#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status