sub hashing { my $s = shift; my $acc = 0; foreach my $c (unpack 'C*', $s) { $acc *= 31; $acc += $c; } return $acc; }