Skip to content

Initializer

init(pseudoRandomFunction:iterations:)

Creates a PBKDF2 password hasher.
init(pseudoRandomFunction: PBKDF2Hasher.HashFunction = .sha256, iterations: Int? = nil)

Parameters

pseudoRandomFunction

The hash function to use. Defaults to SHA-256.

iterations

The number of PBKDF2 iterations. If nil, uses OWASP-recommended defaults based on the hash function.

Discussion

Note

The parameters passed in here will only be used for hashing, verification will rely solely on the parameters inside of the hash.