Skip to content

Instantly share code, notes, and snippets.

@rpf5573
Last active September 26, 2018 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpf5573/53e70175af76be3a139e1a252e59b0dd to your computer and use it in GitHub Desktop.
Save rpf5573/53e70175af76be3a139e1a252e59b0dd to your computer and use it in GitHub Desktop.
const crypto = require('crypto');
const start = Date.now();
crypto.pbkdf2( 'a', 'b', 100000, 512, 'sha512', () => {
console.log( '1:', Date.now() - start );
});
crypto.pbkdf2( 'a', 'b', 100000, 512, 'sha512', () => {
console.log( '2:', Date.now() - start );
});
crypto.pbkdf2( 'a', 'b', 100000, 512, 'sha512', () => {
console.log( '3:', Date.now() - start );
});
crypto.pbkdf2( 'a', 'b', 100000, 512, 'sha512', () => {
console.log( '4:', Date.now() - start );
});
// output
// 2: 2007
// 3: 2008
// 4: 2009
// 1: 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment