Add base32 and 64 password support to genpass
This commit is contained in:
parent
6de2d3375c
commit
93f35b3358
|
@ -14,6 +14,8 @@ Generate random password from /dev/urandom using the character set chosen
|
|||
Option (pick one character set):"
|
||||
local help_options="\t\-a ,\--all\ all printable characters, not including space
|
||||
\t\-lt ,\--limited\ all except special characters [A-Za-z0-9%+,-./:=@^_]
|
||||
\t\-b32 ,\--base32\ all valid base32 characters [A-Z2-7=]
|
||||
\t\-b64 ,\--base64\ all valid base64 characters [A-Za-z0-9+/]
|
||||
\t\-an ,\--alphanumeric\ letters and digits
|
||||
\t\-al ,\--alpha\ letters
|
||||
\t\-u ,\--upper\ upper case letters
|
||||
|
@ -55,42 +57,42 @@ key="$1"
|
|||
|
||||
case $key in
|
||||
-a|--all)
|
||||
all="true"
|
||||
characters="[:graph:]"
|
||||
shift
|
||||
;;
|
||||
-lt|--limited)
|
||||
special="true"
|
||||
characters="A-Za-z0-9%+,-./:=@^_"
|
||||
shift
|
||||
;;
|
||||
-b32|--base32)
|
||||
characters="A-Z2-7="
|
||||
shift
|
||||
;;
|
||||
-b64|--base64)
|
||||
characters="A-Za-z0-9+/"
|
||||
shift
|
||||
;;
|
||||
-an|--alphanumeric)
|
||||
alphanumeric="true"
|
||||
characters="[:alnum:]"
|
||||
shift
|
||||
;;
|
||||
-al|--alpha)
|
||||
alpha="true"
|
||||
characters="[:alpha:]"
|
||||
shift
|
||||
;;
|
||||
-u|--upper)
|
||||
upper="true"
|
||||
characters="[:upper:]"
|
||||
shift
|
||||
;;
|
||||
-l|--lower)
|
||||
lower="true"
|
||||
characters="[:lower:]"
|
||||
shift
|
||||
;;
|
||||
-n|--numeric)
|
||||
numeric="true"
|
||||
characters="[:digit:]"
|
||||
shift
|
||||
;;
|
||||
-h|--hex)
|
||||
hex="true"
|
||||
characters="0-9a-f"
|
||||
shift
|
||||
;;
|
||||
|
|
Loading…
Reference in New Issue