Created
August 24, 2021 03:57
-
-
Save jbarguil/01ebd435ea7f727dac0a19ded20ddc60 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 crypto = require("crypto"); | |
getHash = (content) => crypto.createHash("sha256") | |
.update(content) | |
.digest("hex"); | |
var start = Date.now(); | |
// A million hashes take ~3000ms on my Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz. | |
// You might want to increase this value. | |
for (var i = 0; i < 1000000; i++) | |
getHash("Yeah, Well, That's Just, Like, Your Opinion, Man."); | |
console.log(Date.now() - start); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment