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

Function core_case_hash

hash_func.h:78–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77
78static inline unsigned int core_case_hash( str *s1, str *s2, unsigned int size)
79{
80 char *p, *end;
81 register unsigned v;
82 register unsigned h;
83
84 h=0;
85
86 end=s1->s+s1->len;
87 for ( p=s1->s ; p<=(end-4) ; p+=4 ){
88 v=(ch_icase(*p)<<24)+(ch_icase(p[1])<<16)+(ch_icase(p[2])<<8)
89 + ch_icase(p[3]);
90 ch_h_inc;
91 }
92 v=0;
93 for (; p<end ; p++){ v<<=8; v+=ch_icase(*p);}
94 ch_h_inc;
95
96 if (s2) {
97 end=s2->s+s2->len;
98 for (p=s2->s; p<=(end-4); p+=4){
99 v=(ch_icase(*p)<<24)+(ch_icase(p[1])<<16)+(ch_icase(p[2])<<8)
100 + ch_icase(p[3]);
101 ch_h_inc;
102 }
103 v=0;
104 for (; p<end ; p++){ v<<=8; v+=ch_icase(*p);}
105 ch_h_inc;
106 }
107 h=((h)+(h>>11))+((h>>13)+(h>>23));
108 return size?((h)&(size-1)):h;
109}
110
111
112#endif

Callers 8

imc_add_roomFunction · 0.85
imc_get_roomFunction · 0.85
imc_del_roomFunction · 0.85
imc_add_memberFunction · 0.85
imc_get_memberFunction · 0.85
imc_del_memberFunction · 0.85
add_rule2hashFunction · 0.85
translateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected