/swift-password-validator

Password validator for Swift

Primary LanguageSwiftMIT LicenseMIT

SwiftPasswordValidator

Password validator in Swift, inspired from password-validator

Example

let mediumPassword = PasswordValidatorBuilder()
	.hasLowercase()
	.hasUppercase()
	.hasNumbers()
	.build()
	
let result = mediumPassword.validate("Qwerty123")
// result.success: True

let strongPassword = PasswordValidatorBuilder()
	.hasLowercase()
	.hasUppercase()
	.hasNumbers()
	.hasLength(8)
	.build()
	
let result2 = strongPassword.validate("Qwerty123")
// result2.success: False