This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
reference:password_strength_checking_script [2014/02/27 17:29] – created paul | reference:password_strength_checking_script [2015/09/23 13:46] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 19: | Line 19: | ||
else | else | ||
return true | return true | ||
+ | end | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | A more complex example is: | ||
+ | < | ||
+ | blockedWords = {" | ||
+ | minTypes = 3 | ||
+ | |||
+ | function Check(Username, | ||
+ | | ||
+ | if Password == Username then | ||
+ | | ||
+ | end | ||
+ | |||
+ | for _, value in pairs(blockedWords) do | ||
+ | if lowerPassword == value then | ||
+ | return false | ||
+ | end | ||
+ | end | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | if string.find(Password, | ||
+ | hasDigit = 1 | ||
+ | end | ||
+ | if string.find(Password, | ||
+ | hasCaps = 1 | ||
+ | end | ||
+ | if string.find(Password, | ||
+ | | ||
+ | end | ||
+ | if string.find(Password, | ||
+ | | ||
+ | end | ||
+ | | ||
+ | |||
+ | if differentTypes >= minTypes then | ||
+ | | ||
+ | else | ||
+ | | ||
end | end | ||
end | end |