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

Function hash_func

prime_hash.c:48–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47
48int hash_func (struct sip_msg * msg,
49 enum hash_source source, int denominator) {
50 int ret;
51 unsigned int hash;
52 str source_string;
53
54 if(determine_source (msg, source, &source_string) == -1) {
55 return -1;
56 }
57 crc32_uint(&source_string, &hash);
58
59 ret = hash % denominator;
60 LM_DBG("hash: %u %% %i = %i\n", hash, denominator, ret);
61 return ret;
62}
63
64int prime_hash_func(struct sip_msg * msg,
65 enum hash_source source, int denominator) {

Callers 1

rewrite_on_ruleFunction · 0.85

Calls 2

determine_sourceFunction · 0.85
crc32_uintFunction · 0.85

Tested by

no test coverage detected