Fix incorrect length of password and number gen

This commit is contained in:
pradyun 2023-04-24 11:29:42 +12:00
parent 20327687ff
commit 1f756b1022
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
# Apple-Like Password Changelog
## [Bug Fix] - 2023-04-24
- Fix incorrect length of password
- Fix number sometimes not generating
## [Initial Version] - 2023-04-24

View File

@ -41,7 +41,7 @@ function generate() {
// pick characters
let count = 1;
let passwordSection = "";
for (let i = 1; i < 18; i++) {
for (let i = 1; i <= 18; i++) {
count += 1;
if (NumberPosition === i) {
@ -68,7 +68,7 @@ function generate() {
}
// separate characters into sections
if (i % 6 === 0) {
if (i !== 18 && i % 6 === 0) {
passwordSection += "-";
}
}