Vapor Documentation

Protocol Password​Hasher

public protocol PasswordHasher  
%503 PasswordHasher PasswordHasher Request.Password Request.Password Request.Password->PasswordHasher BcryptHasher BcryptHasher BcryptHasher->PasswordHasher PlaintextHasher PlaintextHasher PlaintextHasher->PasswordHasher Application.Password Application.Password Application.Password->PasswordHasher

Types Conforming to Password​Hasher

Application.Password
Request.Password

Default Implementations

async(on:​hop​To:​)

public func async(
        on threadPool: NIOThreadPool,
        hopTo eventLoop: EventLoop
    ) -> AsyncPasswordHasher  

hash(_:​)

public func hash(_ password: String) throws -> String  

verify(_:​created:​)

public func verify(_ password: String, created digest: String) throws -> Bool  

Requirements

hash(_:​)

func hash<Password>(_ password: Password) throws -> [UInt8]
        where Password: DataProtocol

verify(_:​created:​)

func verify<Password, Digest>(
        _ password: Password,
        created digest: Digest
    ) throws -> Bool
        where Password: DataProtocol, Digest: DataProtocol