in reply to Re^3: Question: Generate unique/random 12-digit keys for 25,000K records, howto??
in thread Question: Generate unique/random 12-digit keys for 25,000K records, howto??

That's actually not that far fetched.

use Digest::MD5 'md5_hex'; my $x = 'a'; my %found; my $key; while (1) { $key = substr md5_hex($x), 0, 8; if ( exists $found{$key} ) { my $first_md5 = md5_hex( $found{$key} ); my $second_md5 = md5_hex( $x ); die "found $key at $x ($second_md5) and $found{$key} ($first_m +d5)\n"; } else { $found{$key} = $x; } $x++; } __END__ found a986d9ee at bwma (a986d9ee140c5acbf0d51c00bc5a7810) and kot (a98 +6d9ee785f7b5fdd68bb5b86ee70e0)

With only eight hex digits, there's only 4_294_967_296 different hashes. You can exhaust that pretty quck.