Skip to content

Instantly share code, notes, and snippets.

@blizzarddreams
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save blizzarddreams/f63db906f672278936f5 to your computer and use it in GitHub Desktop.

Select an option

Save blizzarddreams/f63db906f672278936f5 to your computer and use it in GitHub Desktop.
register
var crypto = require('crypto');
function register(user, pass) {
var salt = crypto.randomBytes(256).toString('base64');
crypto.pbkdf2(pass, salt, 4096, 512, 'sha256', function(err, key) {
if (err) console.log(err);
var hash = key.toString('hex');
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment