Add crc32 function

This commit is contained in:
atxr 2024-02-26 10:20:35 +01:00
parent 88becd6097
commit 43ac716bf2
3 changed files with 65 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#include "libmineziper_crypto.h"
unsigned int xcrc32(const unsigned char *buf, int len, unsigned int init)
{
unsigned int crc = init;
while (len--)
{
crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ *buf) & 255];
buf++;
}
return crc;
}