Created
April 23, 2020 19:02
Test argon2 timings under Nodejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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