You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
323 B
8 lines
323 B
var crypto = require('crypto');
|
|
|
|
export function HashPassword(password: string, salt: string, callback: (arg: string, index?:string) => void) {
|
|
crypto.pbkdf2(password, salt, 100000, 64, 'sha512', (err: string, derivedKey: Buffer) => {
|
|
if (err) throw err;
|
|
callback(derivedKey.toString('hex'));
|
|
});
|
|
} |