Files
mir_server/sdk/utils/crc.h
aixianling 5c9f1dae4a init
2025-01-09 17:45:40 +08:00

34 lines
791 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _WYLIB_CRC_H_
#define _WYLIB_CRC_H_
/**
* wylib 2006 - 2011 快速CRC运算函数库
* 通过预先计算出CRC码表并使用汇编函数书写CRC计算函数
* 将码表通过内联到函数代码中使用CPU的一级指令缓存快
* 速访问码表来提高函数效率。
*/
#ifndef STDCALL
#define STDCALL __stdcall
#endif
#ifdef __cplusplus
extern "C"
{
#endif
/**
* Comments: CRC32值计算函数对data的datalen字节计算crc值
* Param DWORD crc: 原始crc值
* Param const void * data: 数据段指针
* Param UINT_PTR datalen: 要计算数据段中crc值的字节数量
* @Return DWORD : 对数据进行crc32计算的结果
*/
unsigned int CRC32Update(unsigned int crc, const void* data, int datalen);
#ifdef __cplusplus
}
#endif
#endif