Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
The utils_stringHash function is generating the same id for a set of different strings.
The following code can be used (the DJB2 Hash algorithm):
--------------------------------------------
unsigned int hc = 5381;
char ch;
while((ch = *string++) != '\0') {
hc = (hc << 5) + hc + ch;
}
return hc;
---------------------------------------------
See: http://www.cse.yorku.ca/~oz/hash.html
Attachments
Attachments
Issue Links
- links to