Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# hex.h

    00001 #ifndef CRYPTOPP_HEX_H
    00002 #define CRYPTOPP_HEX_H
    00003
    00004 #include "basecode.h"
    00005
    00006 NAMESPACE_BEGIN(CryptoPP)
    00007
    00008 //! Converts given data to base 16
    00009 class CRYPTOPP_DLL HexEncoder : public SimpleProxyFilter
    00010 {
    00011 public:
    00012         HexEncoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int outputGroupSize = 0, const std::string &seperator = ":", const std::string &terminator = "")
    00013                 : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
    00014         {
    00015                 IsolatedInitialize(MakeParameters("Uppercase", uppercase)("GroupSize", outputGroupSize)("Seperator", ConstByteArrayParameter(seperator)));
    00016         }
    00017
    00018         void IsolatedInitialize(const NameValuePairs &parameters);
    00019 };
    00020
    00021 //! Decode 16 bit data back to bytes
    00022 class CRYPTOPP_DLL HexDecoder : public BaseN_Decoder
    00023 {
    00024 public:
    00025         HexDecoder(BufferedTransformation *attachment = NULL)
    00026                 : BaseN_Decoder(GetDecodingLookupArray(), 4, attachment) {}
    00027
    00028         void IsolatedInitialize(const NameValuePairs &parameters) {}
    00029
    00030 private:
    00031         static const int *GetDecodingLookupArray();
    00032 };
    00033
    00034 NAMESPACE_END
    00035
    00036 #endif