Created
July 17, 2013 05:43
-
-
Save anicholson/6017961 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function IsPasswordValid(ByVal Password As String, ByRef Failures As ArrayList) | |
Dim Criteria() As InvalidationCriterion = { | |
new ShorterThanLength(8), | |
new ConsecutiveChars, | |
new NoSpecialChars, | |
new NoNumbers, | |
new NoMixedCase | |
} | |
For Each criterion as InvalidationCriterion in Criteria | |
If criterion.fails(password) | |
Failures.Add(criterion.errorMessage) | |
End If | |
Next | |
Return (Failures.Length == 0) | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment