Created
October 8, 2018 16:46
-
-
Save laouji/62478dbfab13ec4ad7769c28e1d5b384 to your computer and use it in GitHub Desktop.
32 char token generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my $count = $ARGV[0]; | |
if (!defined $count) { | |
$count = 1; | |
} | |
if ($count !~ m/^\d+$/) { | |
die "${count} is not a valid integer"; | |
} | |
my @chars = ("a".."z", 0..9); | |
for (1..$count) { | |
my $string; | |
$string .= $chars[int rand scalar @chars] for 1..32; | |
print $string . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment