This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| reference:password_strength_checking_script [2026/01/05 09:23] – paul | reference:password_strength_checking_script [2026/01/05 09:25] (current) – paul | ||
|---|---|---|---|
| Line 29: | Line 29: | ||
| function Check(Username, | function Check(Username, | ||
| - | | + | local lowerPassword = string.lower(Password) |
| if Password == string.lower(Username) then | if Password == string.lower(Username) then | ||
| | | ||
| Line 40: | Line 40: | ||
| end | end | ||
| - | | + | local hasDigit = 0 |
| - | | + | local hasCaps = 0 |
| - | | + | local hasLower = 0 |
| - | | + | local hasSpecial = 0 |
| if string.find(Password, | if string.find(Password, | ||
| hasDigit = 1 | hasDigit = 1 | ||
| Line 56: | Line 56: | ||
| | | ||
| end | end | ||
| - | | + | local differentTypes = hasDigit + hasCaps + hasLower + hasSpecial |
| if differentTypes >= minTypes then | if differentTypes >= minTypes then | ||