mirror of
https://github.com/octoleo/Purse.git
synced 2025-01-01 13:41:46 +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.
|
# Generate a password.
|
||||||
|
|
||||||
len=40
|
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
|
if [[ ${length} =~ ^[0-9]+$ ]] ; then
|
||||||
len=${length}
|
len=${length}
|
||||||
fi
|
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