sub MakeHashString($)
{
my $string = shift;
my $hash = 0;
my $i = 0;
my $c = 0;
for ($i = 0; $i < length($string); ++$i)
{
$c = ord(substr($string, $i, 1));
$hash = ($c + ($hash * 64) + ($hash * 65536) - $hash) & 0xffffffff;
}
return $hash;
}
####
c = 97, hash = 97 masked hash = 97
c = 99, hash = 6363202 masked hash = 6363202
c = 99, hash = 417419688097 masked hash = 4294967295
c = 101, hash = 281745559584806 masked hash = 4294967295
c = 112, hash = 281745559584817 masked hash = 4294967295
c = 116, hash = 281745559584821 masked hash = 4294967295
####
This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 50 registered patches, see perl -V for more detail)
Copyright 1987-2006, Larry Wall