PwHash

Members

Aliases

makeSalt
alias makeSalt = randomArray!Salt

Generate a salt suitable for hashing passwords.

Functions

hashPassword
string hashPassword(string password, PwHashConfig config)

Create a string that can be used to store a password safely. It includes the hash, the salt, and information about the CPU and memory limits used to compute it.

hashPassword
ubyte[] hashPassword(in char[] password, in Salt salt, PwHashConfig config, size_t length)

Hash a password with a salt. Returns the hash as a ubyte[].

verifyPassword
bool verifyPassword(string password, string storageString)

Verify a password against a storage string obtained from hashPassword

verifyPassword
bool verifyPassword(in ubyte[] hash, string password, in Salt salt, PwHashConfig config)

Verify a password with a hash and salt

Manifest constants

interactivePwHashConfig
enum interactivePwHashConfig;

Password hashing config suitable for interactive use.

interactivePwHashConfig
enum interactivePwHashConfig;

Password hashing config suitable for interactive use.

moderatePwHashConfig
enum moderatePwHashConfig;

Password hashing config suitable for moderate use.

sensitivePwHashConfig
enum sensitivePwHashConfig;

Password hashing config suitable for highly sensitive data

sensitivePwHashConfig
enum sensitivePwHashConfig;

Password hashing config suitable for highly sensitive data.

Meta