Created
July 16, 2014 22:41
-
-
Save JerrySievert/8774737dc992c8526cb3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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