hex.cpp

来自「crypt++ 3.2版本」· C++ 代码 · 共 29 行

CPP
29
字号
// hex.cpp - written and placed in the public domain by Wei Dai

#include "pch.h"
#include "hex.h"

NAMESPACE_BEGIN(CryptoPP)

static const byte s_vecUpper[] = "0123456789ABCDEF";
static const byte s_vecLower[] = "0123456789abcdef";

HexEncoder::HexEncoder(BufferedTransformation *outQueue, bool uppercase)
	: Filter(outQueue), m_vec(uppercase ? s_vecUpper : s_vecLower)
{
}

void HexEncoder::Put(const byte *inString, unsigned int length)
{
	while (length--)
		HexEncoder::Put(*inString++);
}

void HexDecoder::Put(const byte *inString, unsigned int length)
{
	while (length--)
		HexDecoder::Put(*inString++);
}

NAMESPACE_END

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?