Rizin
unix-like reverse engineering framework and cli tools
crc32.h
Go to the documentation of this file.
1 #ifndef CRC32_H
2 #define CRC32_H
3 
4 extern const unsigned int crc32_table[256];
5 
6 /* Return a 32-bit CRC of the contents of the buffer. */
7 
8 static inline unsigned int
9 crc32(unsigned int val, const void *ss, int len)
10 {
11  const unsigned char *s = ss;
12  while (--len >= 0)
13  val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
14  return val;
15 }
16 
17 #endif
size_t len
Definition: 6502dis.c:15
ut16 val
Definition: armass64_const.h:6
const unsigned int crc32_table[256]
Definition: crc32.c:42
static unsigned int crc32(unsigned int val, const void *ss, int len)
Definition: crc32.h:9
static RzSocket * s
Definition: rtr.c:28