String::MkPasswd(3pm)
π String::MkPasswd π
okay so bestie, this is the String::MkPasswd page from the User Contributed Perl Documentation set β it's the manual for a lil Perl library that makes random passwords for you, and honestly? she ate. β¨
πΈ NAME πΈ
String::MkPasswd β random password generator π
β¨ SYNOPSIS β¨
use String::MkPasswd qw(mkpasswd);
print mkpasswd();
# for the masochisticly paranoid...
print mkpasswd(
-length => 27,
-minnum => 5,
-minlower => 1, # minlower is increased if necessary
-minupper => 5,
-minspecial => 5,
-distribute => 1,
);
like look at her. one function. zero drama. π
π¦ ABSTRACT π¦
This Perl library defines a single function, mkpasswd(), and its whole entire job is generating random passwords. It's meant to be the easy lil way for developers and sysadmins to whip up a password that's relatively secure without overthinking it. no cap. π«Ά
π DESCRIPTION π
The exportable mkpasswd() function returns a single scalar: a random password. π
By default, that password is nine characters long, with a random distribution of four lower-case characters, two upper-case characters, two digits, and one non-alphanumeric character. literally the blueprint. π
All of those parameters can be tuned by you, bestie β the deets are in the ARGUMENTS section below. π
π ARGUMENTS π
The mkpasswd() function takes an optional hash of arguments. (yes, optional. she's chill like that.)
-lengthβ the total length of the password. the default is9.-minnumβ the minimum number of digits that will appear in the final password. the default is2.-minlowerβ the minimum number of lower-case characters that will appear in the final password. the default is2.-minupperβ the minimum number of upper-case characters that will appear in the final password. the default is2.-minspecialβ the minimum number of non-alphanumeric characters that will appear in the final password. the default is1.-distributeβ if you set this to a true value, the password characters get distributed between the left- and right-hand sides of the keyboard. this makes it harder for an onlooker to read your password while you're typing it (sneaky-vision protection, we love her for it π). the default isfalse.-noambiguousβ if you set this to a true value, the password characters won't include any that might be mistaken for others. this is particularly helpful if you're distributing a printed list of passwords to a group of people. the default isfalse.-fatalβ if you set this to a true value,mkpasswd()willCarp::croak()rather than returnundefon error. the default isfalse.
β οΈ okay important math class moment: if-minnum,-minlower,-minupper, and-minspecialdo not add up to-length, then-minlowerwill be increased to compensate. BUT if-minnum,-minlower,-minupper, and-minspecialadd up to more than-length, thenmkpasswd()will returnundef. if you wanna change that behavior, go read the EXCEPTION HANDLING section rn. π₯
π EXCEPTION HANDLING π
By default, mkpasswd() will return undef if it cannot generate a password. some people are just ~inclined to exception handling~, so String::MkPasswd does its best to accommodate them. π₯Ί
If the variable $String::MkPasswd::FATAL is set to a true value, mkpasswd() will Carp::croak() with an error instead of returning undef. boom. drama mode activated. π
π EXPORT π
None by default. The mkpasswd() method is exportable. (you gotta ask for her by name, she doesn't just show up uninvited. main character boundaries. π
)
π SEE ALSO π
π§ AKNOWLEDGEMENTS π§
Don Libes of the National Institute of Standards and Technology, who wrote the Expect example, mkpasswd(1). absolute legend. thank you for your service. π«‘π
π AUTHOR π
Chris Grau <cgrau@cpan.org>
π COPYRIGHT AND LICENSE π
Copyright (C) 2003-2012 by Chris Grau
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.
and that's the whole page bestie, mwah π β this was perl v5.36.0, dated 2022-10-22, and it's the String::MkPasswd(3pm) manual. go forth and generate slay passwords. πβ¨π
π¦ where this page comes from
- ubuntu noble: libstring-mkpasswd-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libstring-mkpasswd-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libstring-mkpasswd-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms