28 lines
524 B
JavaScript
28 lines
524 B
JavaScript
"use strict"
|
|
|
|
function checkIfContainsCapital(string){
|
|
for (let i=0; i<string.length;i++){
|
|
if (string.charCodeAt(i) >= 65 &&
|
|
string.charCodeAt(i) <= 90){
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function isStrongPassword(string){
|
|
if (string.length < 8){
|
|
return false;
|
|
}
|
|
if (string.indexOf("password") != -1){
|
|
return false;
|
|
}
|
|
if (checkIfContainsCapital(string) == false){
|
|
return false;
|
|
}
|
|
return true;
|
|
|
|
}
|
|
|
|
// (setq gc-cons-threshold 200000000)
|