Argon2id, in one column
The default is Argon2id at the OWASP minimum. The result is a single PHC string with the algorithm, parameters and salt, so you store one value and can raise the cost later.
const stored = await hashPassword(password);
await verifyPassword(password, stored);
await verifyPassword('wrong guess', stored);
needsRehash(stored);
needsRehash(scryptHash);- stored
- $argon2id$v=19$m=19456,t=2,p=1$D+TxuN/RoW7bHkm3aspRQg$K9lOHm4+omc8PMtJ7rf4gOdNLHeqJW2Q0/HZpWuRIgQ
- right password
- true
- wrong password
- false
- needsRehash(stored)
- false
- needsRehash(scrypt)
- true