Put limit on password length
This commit is contained in:
parent
023fdc2aae
commit
fed7a7d84a
35
functions.sh
35
functions.sh
@ -13,13 +13,21 @@ shaStatic(){
|
|||||||
|
|
||||||
shaWithNum(){
|
shaWithNum(){
|
||||||
#hashes date with SHA
|
#hashes date with SHA
|
||||||
echo
|
if [ $1 -ge 255 ];then
|
||||||
echo "$1 character password generated using SHA256 with date"
|
echo
|
||||||
echo "***************************************************"
|
echo "Error : $0 : Please choose a number lower than 255"
|
||||||
date +%s | sha256sum | base64 | head -c $1 ; echo
|
echo
|
||||||
echo "***************************************************"
|
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo "$1 character password generated using SHA256 with date"
|
||||||
|
echo "***************************************************"
|
||||||
|
date +%s | sha256sum | base64 | head -c $1 ; echo
|
||||||
|
echo "***************************************************"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
leftHand(){
|
leftHand(){
|
||||||
echo
|
echo
|
||||||
echo "8 character password easy to type with left hand"
|
echo "8 character password easy to type with left hand"
|
||||||
@ -29,9 +37,16 @@ leftHand(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
leftHandNum(){
|
leftHandNum(){
|
||||||
echo
|
if [ $1 -ge 255 ];then
|
||||||
echo "$1 character password easy to type with left hand"
|
echo
|
||||||
echo "**************************************************"
|
echo "Error : $0 : Please choose a number lower than 255"
|
||||||
</dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c$1; echo ""
|
echo
|
||||||
echo "**************************************************"
|
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo "$1 character password easy to type with left hand"
|
||||||
|
echo "**************************************************"
|
||||||
|
</dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c$1; echo ""
|
||||||
|
echo "**************************************************"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user