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

📄 crc.h

📁 C++ patterns设计模式
💻 H
字号:
#ifndef INCLUDED_CRC
#define INCLUDED_CRC

#if defined(HAS_PRAGMA_ONCE)
#pragma PRAGMA_ONCE_DECLARE
#endif

#ifdef NO_PRECOMPILE_HEADER
#include <string>
#endif

namespace stk
{
	typedef unsigned char  u8;
	typedef unsigned short u16;
	typedef unsigned int   u32;
	
	class CRCITU
	{
	public:
		// CRC16
		static u16 calc(const u8 *processData, size_t dataLength);
		static u16 calc(const std::string &data)
		{
			return calc((const u8 *)data.c_str(), data.length());
		}
		static u16 s_CRC16Table[];
	};

	class CRC32
	{
	public:
		//CRC32
		static u32 calc(const u8 *processData, size_t dataLength);
		static u32 calc(const std::string &data)
		{
			return calc((const u8 *)data.c_str(), data.length());
		}
		static u32 s_CRC32Table[];
	};
}

#endif

⌨️ 快捷键说明

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