mirror of
https://github.com/0TheSpy/Seaside.git
synced 2025-01-11 11:33:01 +08:00
25 lines
503 B
C
25 lines
503 B
C
|
#ifndef CHECKSUM_CRC_H
|
||
|
#define CHECKSUM_CRC_H
|
||
|
#ifdef _WIN32
|
||
|
#pragma once
|
||
|
#endif
|
||
|
|
||
|
typedef unsigned int CRC32_t;
|
||
|
|
||
|
void CRC32_Init(CRC32_t* pulCRC);
|
||
|
void CRC32_ProcessBuffer(CRC32_t* pulCRC, const void* p, int len);
|
||
|
void CRC32_Final(CRC32_t* pulCRC);
|
||
|
CRC32_t CRC32_GetTableEntry(unsigned int slot);
|
||
|
|
||
|
inline CRC32_t CRC32_ProcessSingleBuffer(const void* p, int len)
|
||
|
{
|
||
|
CRC32_t crc;
|
||
|
|
||
|
CRC32_Init(&crc);
|
||
|
CRC32_ProcessBuffer(&crc, p, len);
|
||
|
CRC32_Final(&crc);
|
||
|
|
||
|
return crc;
|
||
|
}
|
||
|
|
||
|
#endif
|