#ifndef CRC_H__ #define CRC_H__ #include "traits.h" struct crc32 { uint32_t crc; crc32 () { crc = ~uint32_t (0); } void operator ()(const uint8_t byte) { extern const uint32_t crc_32_tab[256]; crc = crc_32_tab[uint8_t (crc) ^ byte] ^ (crc >> 8); } operator uint32_t () { return crc; } }; #endif