For nefarious purposes of my own (actually to make non-predictable unique keys for a db table 8-) I'm doing the following to generate random 25-character strings:
my @chars=("A".."Z","a".."z",0..9); my $key = join("", @chars[ map { rand @chars } ( 1 .. 25 ) ]);
How likely is this to ever come up with the same 25 char string more than once? Can I realistically treat this as a non-repeating random function?
In reply to How likely is rand() to repeat? by desertrat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |