MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / crc32_uint

Function crc32_uint

crc.c:244–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244void crc32_uint (str *source_string, unsigned int *hash_ret) {
245 unsigned int hash;
246 unsigned int len;
247 const unsigned char *data;
248
249 hash = 0xffffffff;
250 data = (const unsigned char *)source_string->s;
251 for (len = source_string->len / 4; len--; data += 4) {
252 hash = crc_32_tab[((unsigned char)hash) ^ data[0]] ^ (hash >> 8);
253 hash = crc_32_tab[((unsigned char)hash) ^ data[1]] ^ (hash >> 8);
254 hash = crc_32_tab[((unsigned char)hash) ^ data[2]] ^ (hash >> 8);
255 hash = crc_32_tab[((unsigned char)hash) ^ data[3]] ^ (hash >> 8);
256 }
257 for (len = source_string->len % 4; len--; data++) {
258 hash = crc_32_tab[((unsigned char)hash) ^ *data] ^ (hash >> 8);
259 }
260 *hash_ret = hash;
261}
262
263/* End of crc.c */

Callers 2

tr_eval_stringFunction · 0.85
hash_funcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected