in reply to Prepaid Cards
Its not clear exactly what you're looking for. Is there some specification for the codes you need? If you just want to generate a batch of unique random id codes you can do something like this:
# use hash keys to hold unique id codes my %id_codes; # number of codes to generate my $batch_qty = 100; # length of id code my $length = 24; while (scalar keys(%id_codes) < $batch_qty){ my $id; for (1..$length){ $id .= ('A'..'Z', 'a'..'z', '0'..'9')[rand(62)]; } $id_codes{$id} = 1; }
If you don't want to keep track of all the id codes generated, you should probably look at some form of public & private key encryption.
|
|---|