view crc32c.c @ 2:ead9f84d11db

*: make it work on non-x86 too
author Paper <paper@tflc.us>
date Mon, 09 Feb 2026 01:21:00 -0500
parents 422835bc1aca
children 6483683ac857
line wrap: on
line source

#include "crc32i.h"

uint32_t crc32c_r(uint32_t crc, const unsigned char *message, size_t sz)
{
	size_t i;

	for (i = 0; i < sz; i++)
		crc = (crc >> 8) ^ crc32_tab[(crc ^ message[i]) & 0xFF];

	return crc;
}