Update a running CRC-32 checksum with the bytes of buf[0..len-1] and return the updated checksum. If buf is empty, this function returns the required initial value for the checksum.
unsigned int crc = xcrc32(0, 0);
while (read_buffer(buffer, length) != EOF)
{
crc = xcrc32(crc, buffer);
}
if (crc != original_crc) error();
crc |
buf |
Result |