I\'m trying to hash a string into an integer for placing it in an array. However I do not know all too much about hashing functions, and that\'s why my current method is jus
I've tried many fast hash functions and chosen this one:
function StrHash(const st:string):cardinal; var i:integer; begin result:=0; for i:=1 to length(st) do result:=result*$20844 xor byte(st[i]); end;
It is as fast as K&R function (actually even faster) but makes better (more even) distribution.