Last active
April 21, 2016 15:52
-
-
Save alsotang/9c9402f88af401f58987c711384cb32c to your computer and use it in GitHub Desktop.
Node.js crypto benchmark
This file contains hidden or 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
| var hasha = require('hasha') | |
| var utility = require('utility') | |
| var fs = require('fs') | |
| var str = fs.readFileSync(__filename) | |
| suite('md5', function () { | |
| bench('utility.md5', function() { | |
| utility.md5(str); | |
| }); | |
| bench('hasha.md5', function() { | |
| hasha(str, {algorithm: 'md5'}); | |
| }); | |
| bench('hasha.sha256', function() { | |
| hasha(str, {algorithm: 'sha256'}); | |
| }); | |
| bench('hasha.sha512', function() { | |
| hasha(str, {algorithm: 'sha512'}); | |
| }); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use
matchalib