diff options
Diffstat (limited to 'common/crc32.h')
-rw-r--r-- | common/crc32.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/crc32.h b/common/crc32.h new file mode 100644 index 0000000..badf467 --- /dev/null +++ b/common/crc32.h @@ -0,0 +1,18 @@ +#ifndef __CRC32_H__ +#define __CRC32_H__ + +#include <unistd.h> + +uint32_t crc32_update(uint32_t old_state, uint8_t c); + +inline static uint32_t crc32_reset(void); +uint32_t crc32_reset() { + return ~0; +} + +inline static uint32_t crc32_finalize(uint32_t state); +uint32_t crc32_finalize(uint32_t state) { + return ~state; +} + +#endif /* __CRC32_H__ */ |