File indexing completed on 2025-01-18 09:55:03
0001
0002
0003
0004
0005
0006 #ifndef CRYPTOPP_HEX_H
0007 #define CRYPTOPP_HEX_H
0008
0009 #include "cryptlib.h"
0010 #include "basecode.h"
0011
0012 NAMESPACE_BEGIN(CryptoPP)
0013
0014
0015 class CRYPTOPP_DLL HexEncoder : public SimpleProxyFilter
0016 {
0017 public:
0018
0019
0020
0021
0022
0023
0024 HexEncoder(BufferedTransformation *attachment = NULLPTR, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
0025 : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
0026 {
0027 IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
0028 }
0029
0030 void IsolatedInitialize(const NameValuePairs ¶meters);
0031 };
0032
0033
0034 class CRYPTOPP_DLL HexDecoder : public BaseN_Decoder
0035 {
0036 public:
0037
0038
0039 HexDecoder(BufferedTransformation *attachment = NULLPTR)
0040 : BaseN_Decoder(GetDefaultDecodingLookupArray(), 4, attachment) {}
0041
0042 void IsolatedInitialize(const NameValuePairs ¶meters);
0043
0044 private:
0045 static const int * CRYPTOPP_API GetDefaultDecodingLookupArray();
0046 };
0047
0048 NAMESPACE_END
0049
0050 #endif