Last active
May 20, 2020 13:26
-
-
Save woubuc/ff512566616ca1867aadb13e66e346fa to your computer and use it in GitHub Desktop.
This file contains 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
const crypto = require('crypto'); | |
// Generate salt from player name | |
let hasher = crypto.createHash('sha1'); | |
let salt = hasher.update(name).digest('base64'); | |
// Generate pbkdf2 hash from ID using generated salt | |
crypto.pbkdf2(id, new Buffer(salt), 1000, 24, 'sha1', (err, key) => { | |
let passwordHash = key.toString('hex'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment