in reply to Generating A Hash Value

What exactly is your problem? you happen to have the algorithm, all you have to do is write it down in perl ;) Here is a rather clumsy solution, since you don't provide a test-sample, I don't know if the results are correct:

use strict; use warnings; my @strings = ('abzdefghijk', 'a b z d e f g h i j k', '', 'abzde fghijk',); print $_, " => ", hc($_), "\n" for @strings; sub hc { my $string = shift; my $erg = 0; my $max = int(length($string) - 1); # this line is your algorithm! $erg += (ord(substr($string,$_,1)))*31**($max-$_) for 0..$max; $erg; }
I'd like a way to get rid of the substr ;)

regards,
tomte


Hlade's Law:

If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.