⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crc.h

📁 300中加密方法
💻 H
字号:
#ifndef CRYPTOPP_CRC32_H
#define CRYPTOPP_CRC32_H

#include "cryptlib.h"

NAMESPACE_BEGIN(CryptoPP)

/* Must use this value instead of ~0 due to 64-bit computers */
const unsigned long CRC32_NEGL = 0xffffffffL;

class CRC32 : public HashModule
{
public:
	CRC32();
	void Update(const byte *input, unsigned int length);
	void Final(byte *hash);
	unsigned int DigestSize() const {return 4;}

	void Reset() {curr_crc = CRC32_NEGL;}
	void UpdateByte(byte b) {curr_crc = crc_32_tab[byte(curr_crc ^ b)] ^ (curr_crc >> 8);}
	word32 GetCrc() const {return curr_crc ^ CRC32_NEGL;}

private:
	static const unsigned long crc_32_tab[256];
	unsigned long curr_crc;
};

NAMESPACE_END

#endif

⌨️ 快捷键说明

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