PwHash.makeSalt

Generate a salt suitable for hashing passwords.

template PwHash(Algorithm alg)
alias makeSalt = randomArray!Salt

Examples

auto salt = makeSalt();
auto hash = hashPassword("password", salt, interactivePwHashConfig, 32);
assert(verifyPassword(hash, "password", salt, interactivePwHashConfig));
import std.stdio;
auto storageString = hashPassword("password", interactivePwHashConfig);
writeln("Hashed Password: ", storageString);
assert(verifyPassword("password", storageString));

Meta