00001 #ifndef __XRDOUCCRC32C_HH__ 00002 #define __XRDOUCCRC32C_HH__ 00003 // crc32c.h -- header for crc32c.c 00004 // Copyright (C) 2015 Mark Adler 00005 // See crc32c.c for the license. 00006 00007 #include <stdint.h> 00008 00009 // Return the CRC-32C of buf[0..len-1] given the starting CRC crc. This can be 00010 // used to calculate the CRC of a sequence of bytes a chunk at a time, using 00011 // the previously returned crc in the next call. The first call must be with 00012 // crc == 0. crc32c() uses the Intel crc32 hardware instruction if available. 00013 uint32_t crc32c(uint32_t crc, void const *buf, size_t len); 00014 00015 // crc32c_sw() is the same, but does not use the hardware instruction, even if 00016 // available. 00017 uint32_t crc32c_sw(uint32_t crc, void const *buf, size_t len); 00018 #endif