mirror of
https://github.com/octoleo/Purse.git
synced 2024-12-28 20:12:38 +00:00
Accurate max password length
This commit is contained in:
parent
c8e0f6d494
commit
bfeece461b
5
pwd.sh
5
pwd.sh
@ -76,13 +76,14 @@ gen_pass () {
|
||||
# Generate a password.
|
||||
|
||||
len=40
|
||||
read -p "Password length? (default: 40, max: 80) " length
|
||||
read -p "Password length? (default: 40, max: 100) " length
|
||||
|
||||
if [[ ${length} =~ ^[0-9]+$ ]] ; then
|
||||
len=${length}
|
||||
fi
|
||||
|
||||
${gpg} --gen-random -a 0 80 | cut -c -${len}
|
||||
# base64: 4 characters for every 3 bytes
|
||||
${gpg} --gen-random -a 0 75 | cut -c -${len}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user