HashedPassword
public struct HashedPasswordThis class represents hashed passwords. They can be used to store passwords for the purpose of authenticating users. Passwords should not be stored as plaintext values to avoid compromise if they get in the wrong hands.
Example
let password = Password("Correct Horse Battery Staple")!
let hashedPassword = password.hash()!
// Store `hashedPassword.string` to database.
// If a user wants to authenticate, just read it from the database and
// verify it against the password given by the user.
if hashedPassword.isVerified(by: password) {
    // The user is authenticated successfully.
}
- 
                  
                  The size of the hashed password string in bytes. As the string is ASCII encoded it will match the number of characters. DeclarationSwift public static let SizeInBytes: UInt32
- 
                  
                  The hashed password. DeclarationSwift let bytes: Bytes
- 
                  
                  Constructs a HashedPasswordinstance from a hashed password.DeclarationSwift public init?(_ bytes: Bytes)ParametersbytesThe hashed password as ASCII decoded string. 
- 
                  
                  Construct a HashedPasswordinstance from a hashed password string.DeclarationSwift public init?(_ string: String)ParametersstringThe hashed password as ASCII encoded string. 
- 
                  
                  Returns an ASCII encoded representation of the hashed password. This value can be securely stored on disk or in a database. DeclarationSwift public var string: String { get }
- 
                  
                  Check if the password passwordauthenticates the hashed password.DeclarationSwift public func isVerified(by password: Password) -> BoolParameterspasswordThe password, the user is trying to authenticate with. 
 View on GitHub
            View on GitHub
           HashedPassword Structure Reference
      HashedPassword Structure Reference