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

Function crc32_z

freebsd/contrib/zlib/crc32.c:202–234  ·  view source on GitHub ↗

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

(crc, buf, len)

Source from the content-addressed store, hash-verified

200
201/* ========================================================================= */
202unsigned long ZEXPORT crc32_z(crc, buf, len)
203 unsigned long crc;
204 const unsigned char FAR *buf;
205 z_size_t len;
206{
207 if (buf == Z_NULL) return 0UL;
208
209#ifdef DYNAMIC_CRC_TABLE
210 if (crc_table_empty)
211 make_crc_table();
212#endif /* DYNAMIC_CRC_TABLE */
213
214#ifdef BYFOUR
215 if (sizeof(void *) == sizeof(ptrdiff_t)) {
216 z_crc_t endian;
217
218 endian = 1;
219 if (*((unsigned char *)(&endian)))
220 return crc32_little(crc, buf, len);
221 else
222 return crc32_big(crc, buf, len);
223 }
224#endif /* BYFOUR */
225 crc = crc ^ 0xffffffffUL;
226 while (len >= 8) {
227 DO8;
228 len -= 8;
229 }
230 if (len) do {
231 DO1;
232 } while (--len);
233 return crc ^ 0xffffffffUL;
234}
235
236/* ========================================================================= */
237unsigned long ZEXPORT crc32(crc, buf, len)

Callers 2

zstd_zlibwrapper.cFile · 0.85
crc32Function · 0.85

Calls 3

make_crc_tableFunction · 0.85
crc32_littleFunction · 0.85
crc32_bigFunction · 0.85

Tested by

no test coverage detected