mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-03-17 19:21:01 +00:00
10 lines
380 B
JavaScript
10 lines
380 B
JavaScript
async function hashPassword(pwd,salt){
|
|
const{scrypt}=await import('https://cdn.skypack.dev/scrypt-js');
|
|
const pw=new TextEncoder().encode(pwd);
|
|
const st=new TextEncoder().encode(salt);
|
|
const h=await scrypt(pw,st,1024,8,1,32);
|
|
return Array.from(h).map(b=>b.toString(16).padStart(2,'0')).join('');
|
|
}
|
|
export default hashPassword;
|
|
// Generation time: 30.558s
|
|
// Result: PASS
|