Skip to content

Instantly share code, notes, and snippets.

@marcoarruda
Forked from Wats0ns/hashed_Nodejs.js
Created May 7, 2023 13:34
Show Gist options
  • Save marcoarruda/2a4feab1f147ce1b5f110e6a54378c47 to your computer and use it in GitHub Desktop.
Save marcoarruda/2a4feab1f147ce1b5f110e6a54378c47 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