MCPcopy Create free account
hub / github.com/RsyncProject/rsync / crc32_big

Function crc32_big

zlib/crc32.c:279–307  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

277
278/* ========================================================================= */
279local unsigned long crc32_big(unsigned long crc, const unsigned char FAR *buf, unsigned len)
280{
281 register z_crc_t c;
282 register const z_crc_t FAR *buf4;
283
284 c = ZSWAP32((z_crc_t)crc);
285 c = ~c;
286 while (len && ((ptrdiff_t)buf & 3)) {
287 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
288 len--;
289 }
290
291 buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
292 while (len >= 32) {
293 DOBIG32;
294 len -= 32;
295 }
296 while (len >= 4) {
297 DOBIG4;
298 len -= 4;
299 }
300 buf = (const unsigned char FAR *)buf4;
301
302 if (len) do {
303 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
304 } while (--len);
305 c = ~c;
306 return (unsigned long)(ZSWAP32(c));
307}
308
309#endif /* BYFOUR */
310

Callers 1

crc32Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected