From: Roland Häder Date: Tue, 30 May 2017 08:49:57 +0000 (+0200) Subject: fixed comments X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2efd236e1b6a946795ef0f270cbafee34b3ae75f;p=juser-core.git fixed comments Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jusercore/model/user/UserUtils.java b/src/org/mxchange/jusercore/model/user/UserUtils.java index 3f7968e..aafa2c6 100644 --- a/src/org/mxchange/jusercore/model/user/UserUtils.java +++ b/src/org/mxchange/jusercore/model/user/UserUtils.java @@ -110,7 +110,7 @@ public class UserUtils implements Serializable { } /** - * Determines given password's strength: 0 = bad, 100 = best. This method is + * Determines given password's strength: 0 = worst, 100 = best. This method is * based on * http://stackoverflow.com/questions/1614811/how-do-i-measure-the-strength-of-a-password *

@@ -131,40 +131,40 @@ public class UserUtils implements Serializable { // Init score double score = 0.0f; - //password length + // Password length score += password.length() * calculateEntropyFactor(password) / 100; - //password has 3 numbers + // Password has 3 numbers if (ifRegExFoundInString("(.*[0-9].*[0-9].*[0-9].*)+", password)) { //NOI18N score += 5; } - //password has 2 symbols + // Password has 2 symbols if (ifRegExFoundInString("(.*[!,@,#,$,%,^,&,*,/,?,_,~,=,.,-,;,:].*[!,@,#,$,%,^,&,*,/,?,_,~,=,.,-,;,:].*)+", password)) { //NOI18N score += 5; } - //password has Upper and Lower chars + // Password has Upper and Lower chars if (ifRegExFoundInString("(.*[a-z].*[A-Z])|([A-Z].*[a-z].*)+", password)) { //NOI18N score += 10; } - //password has number and chars + // Password has number and chars if (ifRegExFoundInString("(.*[a-zA-Z].*)+", password) && ifRegExFoundInString("(.*[0-9].*)+", password)) { //NOI18N score += 15; } - //password has number and symbol + // Password has number and symbol if (ifRegExFoundInString("(.*[!,@,#,$,%,^,&,*,/,?,_,~,=,.,-,;,:].*)+", password) && ifRegExFoundInString("(.*[0-9].*)+", password)) { //NOI18N score += 15; } - //password has char and symbol + // Password has char and symbol if (ifRegExFoundInString("(.*[!,@,#,$,%,^,&,*,/,?,_,~,=,.,-,;,:].*)+", password) && ifRegExFoundInString("(.*[a-zA-Z].*)+", password)) { //NOI18N score += 15; } - //password is just numbers or chars + // Password is just numbers or chars if (ifRegExFoundInString("^[a-zA-Z]+$", password) || ifRegExFoundInString("^[0-9]+$", password)) { //NOI18N score -= 10; }