mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
9 lines
236 B
TypeScript
9 lines
236 B
TypeScript
import crypto from 'crypto';
|
|
|
|
function hash(password: string, salt: string) {
|
|
return crypto.pbkdf2Sync(password, salt, 100000, 64, 'sha256').toString('hex').substring(0, 64);
|
|
}
|
|
|
|
export = hash;
|
|
global.Hydro.module.hash.hydro = hash;
|