Express With Users implements
GitHub - node-argon2
for password hashing and verifying.
Results are computed for the password: P@ssw0rd. A page refresh will generate new hashes.
import argon2 from 'argon2';
...
const password = 'P@ssw0rd';
const hashedPassword1 = await argon2.hash(password);
const verified1 = await argon2.verify(hashedPassword1, password);
const hashedPassword2 = await argon2.hash(password);
const verified2 = await argon2.verify(hashedPassword2, password);
hashedPassword1:
$argon2id$v=19$m=65536,t=3,p=4$NMqunuggai3CYO3WVdBIag$icLluZ8z+uK/+rtWDn7YD4wXsAs+trclqh9Suey6lH0
verified1: true
Same password, different hash.
hashedPassword2:
$argon2id$v=19$m=65536,t=3,p=4$QnW65WGVA7sPJ0ULbSEH4Q$9i3rJVYpPG2GBYMDKvLkDQG2VKHfpLjrzCG9Lor//3A
verified2: true