Last active
November 6, 2017 02:20
-
-
Save edt11x/60fed669ebc30743d353c6c915f8fd3f to your computer and use it in GitHub Desktop.
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; | |
use Getopt::Long; | |
# my @set = ('0' .. '9', 'A' .. 'Z', 'a' .. 'z'); | |
# non ambiguous characters | |
# https://ux.stackexchange.com/questions/21076/are-there-numbers-and-letters-to-avoid-for-activation-codes-via-sms | |
my @set = split //,'abcdefghkmnoprstwxzABCDEFGHJKLMNPQRTWXY34689'; | |
my $pwLen = 63; | |
GetOptions('long=i' => \$pwLen); | |
if ($pwLen < 1) { | |
$pwLen = 63; | |
} | |
my $passwd = join '' => map $set[rand @set], 1 .. $pwLen; | |
print "$passwd\n"; | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment