MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / crc32

Function crc32

zlib/crc32.c:219–251  ·  view source on GitHub ↗

========================================================================= */

(crc, buf, len)

Source from the content-addressed store, hash-verified

217
218/* ========================================================================= */
219unsigned long ZEXPORT crc32(crc, buf, len)
220 unsigned long crc;
221 const unsigned char FAR *buf;
222 unsigned len;
223{
224 if (buf == Z_NULL) return 0UL;
225
226#ifdef DYNAMIC_CRC_TABLE
227 if (crc_table_empty)
228 make_crc_table();
229#endif /* DYNAMIC_CRC_TABLE */
230
231#ifdef BYFOUR
232 if (sizeof(void *) == sizeof(ptrdiff_t)) {
233 u4 endian;
234
235 endian = 1;
236 if (*((unsigned char *)(&endian)))
237 return crc32_little(crc, buf, len);
238 else
239 return crc32_big(crc, buf, len);
240 }
241#endif /* BYFOUR */
242 crc = crc ^ 0xffffffffUL;
243 while (len >= 8) {
244 DO8;
245 len -= 8;
246 }
247 if (len) do {
248 DO1;
249 } while (--len);
250 return crc ^ 0xffffffffUL;
251}
252
253#ifdef BYFOUR
254

Callers 10

val_intMethod · 0.85
my_checksumFunction · 0.85
gz_openFunction · 0.85
ZEXPORTFunction · 0.85
gzwriteFunction · 0.85
gzrewindFunction · 0.85
inflate.cFile · 0.85
deflateResetFunction · 0.85
deflateFunction · 0.85
ifFunction · 0.85

Calls 3

make_crc_tableFunction · 0.85
crc32_littleFunction · 0.85
crc32_bigFunction · 0.85

Tested by

no test coverage detected