Well I came across a great hashing algorithm, known as djb2 hash for hashing
strings..would like to share it:
int get_hash(char *s)
{
int hash = 0;
while(c = *s++)
{
hash = ((hash << 5) + hash) ^ c;
}
return hash;
}
this can be done for each individual string to be hashed..
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/Pq-y4hWnUjYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.