Skip to content

Instantly share code, notes, and snippets.

@maxchehab
Created November 15, 2019 01:02
Show Gist options
  • Save maxchehab/f23d364f3c5494d3557f86a964fcd9f4 to your computer and use it in GitHub Desktop.
Save maxchehab/f23d364f3c5494d3557f86a964fcd9f4 to your computer and use it in GitHub Desktop.
import bcrypt from 'bcrypt';
console.time('1 salt round');
bcrypt.hashSync('hello world', 1);
console.timeEnd('1 salt round');
console.time('10 salt round');
bcrypt.hashSync('hello world', 10);
console.timeEnd('10 salt round');
console.time('13 salt round');
bcrypt.hashSync('hello world', 13);
console.timeEnd('13 salt round');
// Results:
// 1 salt round: 1.866ms
// 10 salt round: 60.055ms
// 13 salt round: 476.671ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment