PasswordGenerator

public protocol PasswordGenerator

Utility for generating a password to satisfy a specified password policy.

  • Generate a random password with specified password policy.

    Declaration

    Swift

    func generatePassword(length: UInt, upperCase: Bool, lowerCase: Bool, special: Bool, number: Bool) -> String

    Parameters

    length

    Password length.

    upperCase

    Requires 1 uppercase character.

    lowerCase

    Requires 1 lowercase character.

    special

    Requires 1 special character.

    number

    Requires 1 numeric character.

    Return Value

    Generated password.