aboutsummaryrefslogtreecommitdiff
path: root/common/crc32.h
blob: badf4676d67a561d01906297aba0a568a0c3a95a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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__ */