in reply to Re^2: Digest (checksum) Algorithm for 12 Decimal Digits? (32bit)
in thread Digest (checksum) Algorithm for 12 Decimal Digits?
The double floats used by perl internally can represent 53 bit integers on most CPU architectures, enough to store the 12 decimal digits:
(actually, the biggest number that can appear in this algorithm is 2.56E+14, that can be represented in 48 bits)my $md5 = ...; my $dd = 0; $dd = ($dd * 256 + ord) % 1e12 for split //, $md5; print "$dd\n";
|
|---|