No infinite loop with password policy with long password with not enough upper, numerical and special characters
This commit is contained in:
parent
2a1f0a3dbb
commit
d8dd7d8ae5
1 changed files with 9 additions and 3 deletions
|
@ -112,6 +112,12 @@ function nchar(num) {
|
||||||
var pass = "";
|
var pass = "";
|
||||||
var pas_chars = [];
|
var pas_chars = [];
|
||||||
var _Lower = _maxLength - _Upper - _Number - _Special;
|
var _Lower = _maxLength - _Upper - _Number - _Special;
|
||||||
|
while (_Lower > 26) {
|
||||||
|
_Upper++;
|
||||||
|
_Number++;
|
||||||
|
_Special++;
|
||||||
|
_Lower = _maxLength - _Upper - _Number - _Special;
|
||||||
|
}
|
||||||
getRandomChars([0, 22], _Special, pas_chars);
|
getRandomChars([0, 22], _Special, pas_chars);
|
||||||
getRandomChars([23, 32], _Number, pas_chars);
|
getRandomChars([23, 32], _Number, pas_chars);
|
||||||
getRandomChars([33, 58], _Upper, pas_chars);
|
getRandomChars([33, 58], _Upper, pas_chars);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue