You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
291 B
JavaScript
13 lines
291 B
JavaScript
const crypto = require('crypto');
|
|
|
|
/**
|
|
* @param {string} password
|
|
* @param {string} salt
|
|
*/
|
|
function hash(password, salt) {
|
|
const res = crypto.pbkdf2Sync(password, salt, 100000, 64, 'sha256');
|
|
return res.toString('Hex');
|
|
}
|
|
|
|
global.Hydro.lib['hash.hydro'] = module.exports = hash;
|