在worker中执行命令

This commit is contained in:
undefined committed 2020-06-17 13:37:25 +08:00
1 parent 5db23edebb
commit f293e1f59e
4 files changed
+27 -18

No files matched your search

+1 -6
View File
@@ -1,12 +1,7 @@
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');
return crypto.pbkdf2Sync(password, salt, 100000, 64, 'sha256').toString('hex');
}
global.Hydro.lib['hash.hydro'] = module.exports = hash;