I need to extract an 8 byte digest from a variable length string so I\'m looking for such an algorithm that I will implement in c/c++. That will be part of a digital signatu
Here is a modified version of a 32 bit version I found in my old source files
static unsigned long long llhash(const char *str)
{
unsigned long long hash = 5381;
int c;
while (c = *str++)
hash = ((hash << 5) + hash) + c;
return hash;
}
But hashing will always result in collisions. Of course some algorithms are better than others.
Edit: I found the source of the 32 bit version: http://www.cse.yorku.ca/~oz/hash.html