1 Star 0 Fork 0

bubuzi_tool/cryptopp870

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
hex.h 1.69 KB
一键复制 编辑 原始数据 按行查看 历史
布布子 提交于 2022-12-12 16:37 . 初始化提交
// hex.h - originally written and placed in the public domain by Wei Dai
/// \file hex.h
/// \brief Classes for HexEncoder and HexDecoder
#ifndef CRYPTOPP_HEX_H
#define CRYPTOPP_HEX_H
#include "cryptlib.h"
#include "basecode.h"
NAMESPACE_BEGIN(CryptoPP)
/// \brief Converts given data to base 16
class CRYPTOPP_DLL HexEncoder : public SimpleProxyFilter
{
public:
/// \brief Construct a HexEncoder
/// \param attachment a BufferedTrasformation to attach to this object
/// \param uppercase a flag indicating uppercase output
/// \param groupSize the size of the output grouping
/// \param separator the separator to use between groups
/// \param terminator the terminator append after processing
HexEncoder(BufferedTransformation *attachment = NULLPTR, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{
IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
}
void IsolatedInitialize(const NameValuePairs &parameters);
};
/// \brief Decode base 16 data back to bytes
class CRYPTOPP_DLL HexDecoder : public BaseN_Decoder
{
public:
/// \brief Construct a HexDecoder
/// \param attachment a BufferedTrasformation to attach to this object
HexDecoder(BufferedTransformation *attachment = NULLPTR)
: BaseN_Decoder(GetDefaultDecodingLookupArray(), 4, attachment) {}
void IsolatedInitialize(const NameValuePairs &parameters);
private:
static const int * CRYPTOPP_API GetDefaultDecodingLookupArray();
};
NAMESPACE_END
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/bubuzi_tool/cryptopp870.git
git@gitee.com:bubuzi_tool/cryptopp870.git
bubuzi_tool
cryptopp870
cryptopp870
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385