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

Function crc32_big

zlib/crc32.c:302–335  ·  view source on GitHub ↗

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

(crc, buf, len)

Source from the content-addressed store, hash-verified

300
301/* ========================================================================= */
302local unsigned long crc32_big(crc, buf, len)
303 unsigned long crc;
304 const unsigned char FAR *buf;
305 unsigned len;
306{
307 register u4 c;
308 register const u4 FAR *buf4;
309
310 c = REV((u4)crc);
311 c = ~c;
312 while (len && ((ptrdiff_t)buf & 3)) {
313 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
314 len--;
315 }
316
317 buf4 = (const u4 FAR *)(const void FAR *)buf;
318 buf4--;
319 while (len >= 32) {
320 DOBIG32;
321 len -= 32;
322 }
323 while (len >= 4) {
324 DOBIG4;
325 len -= 4;
326 }
327 buf4++;
328 buf = (const unsigned char FAR *)buf4;
329
330 if (len) do {
331 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
332 } while (--len);
333 c = ~c;
334 return (unsigned long)(REV(c));
335}
336
337#endif /* BYFOUR */
338

Callers 1

crc32Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected