Skip to content

Instantly share code, notes, and snippets.

@andyj
Created October 8, 2015 10:05
Show Gist options
  • Save andyj/c555c3746dc40c0e1be1 to your computer and use it in GitHub Desktop.
Save andyj/c555c3746dc40c0e1be1 to your computer and use it in GitHub Desktop.
Replicating ColdFusion hash() function in Javascript
var crypto = require('crypto');
var pwd = "Password1!";
var hash = function(str){
return crypto.createHash('sha256').update(pwd).digest('hex').toUpperCase()
}
console.log( hash(pwd) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment