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

Function __bencode_hash_str_len

modules/rtpengine/bencode.c:432–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432static unsigned int __bencode_hash_str_len(const unsigned char *s, int len) {
433 unsigned long *ul;
434 unsigned int *ui;
435 unsigned short *us;
436
437 if (len >= sizeof(*ul)) {
438 ul = (void *) s;
439 return *ul % BENCODE_HASH_BUCKETS;
440 }
441 if (len >= sizeof(*ui)) {
442 ui = (void *) s;
443 return *ui % BENCODE_HASH_BUCKETS;
444 }
445 if (len >= sizeof(*us)) {
446 us = (void *) s;
447 return *us % BENCODE_HASH_BUCKETS;
448 }
449 if (len >= sizeof(*s))
450 return *s % BENCODE_HASH_BUCKETS;
451
452 return 0;
453}
454
455static unsigned int __bencode_hash_str(bencode_item_t *str) {
456 assert(str->type == BENCODE_STRING);

Callers 2

__bencode_hash_strFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected