From fed7a7d84affb69fb9ba938972e3908eb02490a5 Mon Sep 17 00:00:00 2001 From: silvernode Date: Tue, 2 Jun 2015 03:31:37 -0500 Subject: [PATCH] Put limit on password length --- functions.sh | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/functions.sh b/functions.sh index 538e520..19f4282 100644 --- a/functions.sh +++ b/functions.sh @@ -13,13 +13,21 @@ shaStatic(){ shaWithNum(){ #hashes date with SHA - echo - echo "$1 character password generated using SHA256 with date" - echo "***************************************************" - date +%s | sha256sum | base64 | head -c $1 ; echo - echo "***************************************************" + if [ $1 -ge 255 ];then + echo + echo "Error : $0 : Please choose a number lower than 255" + echo + + else + echo + echo "$1 character password generated using SHA256 with date" + echo "***************************************************" + date +%s | sha256sum | base64 | head -c $1 ; echo + echo "***************************************************" + fi } + leftHand(){ echo echo "8 character password easy to type with left hand" @@ -29,9 +37,16 @@ leftHand(){ } leftHandNum(){ - echo - echo "$1 character password easy to type with left hand" - echo "**************************************************" -