+//FNV-1a hash function\r
function makehash(s:ansistring):integer;\r
const\r
shifter=6;\r
var\r
a,b:integer;\r
function makehash(s:ansistring):integer;\r
const\r
shifter=6;\r
var\r
a,b:integer;\r
begin\r
result := 0;\r
b := length(s);\r
begin\r
result := 0;\r
b := length(s);\r
for a := 1 to b do begin\r
for a := 1 to b do begin\r
- result := (result shl shifter) xor byte(s[a]);\r
+ h := (h xor byte(s[a])) * 16777619;\r
- result := (result xor result shr 16) and (hashtable_size-1);\r
+ result := h and (hashtable_size-1);\r
end;\r
\r
procedure addtree(t:phashtable;s:ansistring;item:pointer);\r
end;\r
\r
procedure addtree(t:phashtable;s:ansistring;item:pointer);\r