my $md5 = ...; my $dd = 0; $dd = ($dd * 256 + ord) % 1e12 for split //, $md5; print "$dd\n";