Skip to content

Instantly share code, notes, and snippets.

@alsotang
Last active April 21, 2016 15:52
Show Gist options
  • Select an option

  • Save alsotang/9c9402f88af401f58987c711384cb32c to your computer and use it in GitHub Desktop.

Select an option

Save alsotang/9c9402f88af401f58987c711384cb32c to your computer and use it in GitHub Desktop.
Node.js crypto benchmark
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'});
});
});
@alsotang

Copy link
Copy Markdown
Author

use matcha lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment