fix: hashPassword calls not working due to util file not matching function call name
This commit is contained in:
parent
0c4d42f3c1
commit
8d53b2765f
1 changed files with 0 additions and 0 deletions
7
utils/hashPassword.ts
Normal file
7
utils/hashPassword.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default async (password: string) => {
|
||||
const encodedPass = new TextEncoder().encode(password);
|
||||
const hashBuffer = await crypto.subtle.digest("SHA-384", encodedPass);
|
||||
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
||||
const hashedPass = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
||||
return hashedPass;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue