Skip to content

Instantly share code, notes, and snippets.

@Wats0ns
Created November 10, 2016 08:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Wats0ns/bb6210d4bfb4e0ce9d8db41750661363 to your computer and use it in GitHub Desktop.
Save Wats0ns/bb6210d4bfb4e0ce9d8db41750661363 to your computer and use it in GitHub Desktop.
CakePHP Security::Hash in NodeJS
var crypto = require('crypto');
var hash_sha1 = function(password, salt){
password = salt + password;
var hash = crypto.createHash('sha1');
hash.update(password);
var value = hash.digest('hex');
return value;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment