Skip to content

Instantly share code, notes, and snippets.

@JerrySievert
Created July 16, 2014 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JerrySievert/8774737dc992c8526cb3 to your computer and use it in GitHub Desktop.
Save JerrySievert/8774737dc992c8526cb3 to your computer and use it in GitHub Desktop.
function build_user(username, email, password) {
var user = {};
user.name = username;
user.email = email;
user.salt = crypto.createHash('sha512').update(password).digest('hex');
user.date = new Date();
user.password_hash = hash.generate(password, { saltLength: 8, algorithm: 'sha512' });
return user;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment