| Posted by DJ Stunks on 05/31/06 04:44 
Nospam wrote:> Is there a tutorial on dynamic SID generation?
 
 I don't know of one, but how about something like this:
 
 #!/usr/bin/perl
 
 use strict;
 use warnings;
 
 my $number_of_sids = 10;
 my $max_sid_size   = 10;
 
 my @sids = sort {$a <=> $b}
 map {int rand( '1' . 0 x rand $max_sid_size )}
 (1..rand $number_of_sids);
 
 for my $i (0..$#sids) {
 printf "SID %d: %d\n", $i+1, $sids[$i];
 }
 
 __END__
 
 HTH,
 -jp
 [Back to original message] |