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

Function crc32_little

zlib/crc32.c:242–270  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

240
241/* ========================================================================= */
242local unsigned long crc32_little(unsigned long crc, const unsigned char FAR *buf, unsigned len)
243{
244 register z_crc_t c;
245 register const z_crc_t FAR *buf4;
246
247 c = (z_crc_t)crc;
248 c = ~c;
249 while (len && ((ptrdiff_t)buf & 3)) {
250 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
251 len--;
252 }
253
254 buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
255 while (len >= 32) {
256 DOLIT32;
257 len -= 32;
258 }
259 while (len >= 4) {
260 DOLIT4;
261 len -= 4;
262 }
263 buf = (const unsigned char FAR *)buf4;
264
265 if (len) do {
266 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
267 } while (--len);
268 c = ~c;
269 return (unsigned long)c;
270}
271
272/* ========================================================================= */
273#define DOBIG4 c ^= *buf4++; \

Callers 1

crc32Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected