MCPcopy Create free account
hub / github.com/F-Stack/f-stack / crc32_big

Function crc32_big

freebsd/contrib/zlib/crc32.c:306–337  ·  view source on GitHub ↗

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

(crc, buf, len)

Source from the content-addressed store, hash-verified

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

Callers 1

crc32_zFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected