Skip to content

Instantly share code, notes, and snippets.

@sbmart
Created April 23, 2020 19:02
Show Gist options
  • Save sbmart/68d4da5c8607d0eadf71f4dbf9c16226 to your computer and use it in GitHub Desktop.
Save sbmart/68d4da5c8607d0eadf71f4dbf9c16226 to your computer and use it in GitHub Desktop.
Test argon2 timings under Nodejs
const argon2 = require('argon2');
const signup = async function(password) {
var key = await argon2.hash(password, {
type: argon2.argon2d,
memoryCost: 2 ** 20, //1G
timeCost: 2, //iterations
hashLength: 48,
parallelism: 4,
});
console.log(password);
console.log(key);
return key;
}
console.time('Password Hashing');
signup("rBz5zG9wG0qpZSh9MmyvzSMJvflU8BAZH1I3mmZJ2Igy"); //test password for hashing
console.timeEnd('Password Hashing');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment