#ifndef CRC_H #define CRC_H #include #if __STDC_VERSION__ >= 199901 #include typedef uint_least32_t crc32_t; typedef uint_least16_t crc16_t; #else /* don't have C99? */ typedef unsigned short crc16_t; typedef unsigned crc32_t; #endif /* ANSI X3.66 residual */ #define CRC32_RESIDUE 0xdebb20e3UL #define CRC16_RESIDUE 0xf0b8U crc32_t crc32_calc(const void *ptr, size_t cnt, crc32_t crc); crc16_t crc16_calc(const void *ptr, size_t cnt, crc16_t crc); #endif