diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f06bfd..d1fef37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index 565dc44..a92b64a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -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 += "-"; } }