pin = int( htmlpage.encode("hex"), 16 ) % 10000 #### foreach my $ltr(@ltrs){ $hash = ( $hash + ord($ltr)) %10000;