Skip to content

Instantly share code, notes, and snippets.

@TheDeveloper
Created July 21, 2012 11:20
Show Gist options
  • Save TheDeveloper/3155509 to your computer and use it in GitHub Desktop.
Save TheDeveloper/3155509 to your computer and use it in GitHub Desktop.
Create a hash in node.js
var crypto = require('crypto');
var createHash = function(algo, data, digest){
if(!digest)
digest = 'hex';
return crypto.createHash(algo).update(data).digest(digest);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment