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

Function crc32_little

freebsd/contrib/zlib/crc32.c:266–297  ·  view source on GitHub ↗

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

(crc, buf, len)

Source from the content-addressed store, hash-verified

264
265/* ========================================================================= */
266local unsigned long crc32_little(crc, buf, len)
267 unsigned long crc;
268 const unsigned char FAR *buf;
269 z_size_t len;
270{
271 register z_crc_t c;
272 register const z_crc_t FAR *buf4;
273
274 c = (z_crc_t)crc;
275 c = ~c;
276 while (len && ((ptrdiff_t)buf & 3)) {
277 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
278 len--;
279 }
280
281 buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
282 while (len >= 32) {
283 DOLIT32;
284 len -= 32;
285 }
286 while (len >= 4) {
287 DOLIT4;
288 len -= 4;
289 }
290 buf = (const unsigned char FAR *)buf4;
291
292 if (len) do {
293 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
294 } while (--len);
295 c = ~c;
296 return (unsigned long)c;
297}
298
299/* ========================================================================= */
300#define DOBIG4 c ^= *buf4++; \

Callers 1

crc32_zFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected