Skip to content

Instantly share code, notes, and snippets.

@laouji
Created October 8, 2018 16:46
Show Gist options
  • Save laouji/62478dbfab13ec4ad7769c28e1d5b384 to your computer and use it in GitHub Desktop.
Save laouji/62478dbfab13ec4ad7769c28e1d5b384 to your computer and use it in GitHub Desktop.
32 char token generator
#!/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