Created
April 3, 2020 05:48
-
-
Save sytranvn/fe011bda3ef3e4315bef5d588b3448f3 to your computer and use it in GitHub Desktop.
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 algorithm = 'aes-192-cbc'; | |
const password = 'Password used to generate key'; | |
const LOOPS = process.env.LOOPS || 2; | |
// start mesuring time | |
const hrstart = process.hrtime() | |
for (i=1; i <= LOOPS; i++) { | |
const index = i; | |
const cb = () => { | |
const hrend = process.hrtime(hrstart); | |
console.info('Execution time crypto %d (hr): %ds %dms', index, hrend[0], hrend[1] / 1000000); | |
} | |
const key = crypto.scrypt(password, 'salt', 24, cb); | |
} | |
const pend = process.hrtime(hrstart); | |
console.info('Process ended in (hr): %ds %dms', pend[0], pend[1] / 1000000); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment