93f35b3358c6631f1e21c59b2ab531fd2054874e

Author
Pavle Portic <git@theedgeofrage.com>
Committer
Pavle Portic <git@theedgeofrage.com>
Date

Message

Add base32 and 64 password support to genpass

Diff

 1diff --git a/dot_local/bin/executable_genpass b/dot_local/bin/executable_genpass
 2index 52cc23c84488d567e6bdb2aadd419a97af719ec5..726ed6d2933e692f32e1c45e35ee536dfc52bcbe 100644
 3--- a/dot_local/bin/executable_genpass
 4+++ b/dot_local/bin/executable_genpass
 5@@ -14,6 +14,8 @@ Generate random password from /dev/urandom using the character set chosen
 6 Option (pick one character set):"
 7 local help_options="\t\-a ,\--all\ all printable characters, not including space
 8 	\t\-lt ,\--limited\ all except special characters [A-Za-z0-9%+,-./:=@^_]
 9+	\t\-b32 ,\--base32\ all valid base32 characters [A-Z2-7=]
10+	\t\-b64 ,\--base64\ all valid base64 characters [A-Za-z0-9+/]
11 	\t\-an ,\--alphanumeric\ letters and digits
12 	\t\-al ,\--alpha\ letters
13 	\t\-u ,\--upper\ upper case letters
14@@ -55,42 +57,42 @@ key="$1"
15 
16 case $key in
17 	-a|--all)
18-		all="true"
19 		characters="[:graph:]"
20 		shift
21 		;;
22 	-lt|--limited)
23-		special="true"
24 		characters="A-Za-z0-9%+,-./:=@^_"
25 		shift
26 		;;
27+	-b32|--base32)
28+		characters="A-Z2-7="
29+		shift
30+		;;
31+	-b64|--base64)
32+		characters="A-Za-z0-9+/"
33+		shift
34+		;;
35 	-an|--alphanumeric)
36-		alphanumeric="true"
37 		characters="[:alnum:]"
38 		shift
39 		;;
40 	-al|--alpha)
41-		alpha="true"
42 		characters="[:alpha:]"
43 		shift
44 		;;
45 	-u|--upper)
46-		upper="true"
47 		characters="[:upper:]"
48 		shift
49 		;;
50 	-l|--lower)
51-		lower="true"
52 		characters="[:lower:]"
53 		shift
54 		;;
55 	-n|--numeric)
56-		numeric="true"
57 		characters="[:digit:]"
58 		shift
59 		;;
60 	-h|--hex)
61-		hex="true"
62 		characters="0-9a-f"
63 		shift
64 		;;