feat: sign in sign up with all views
This commit is contained in:
7
kittyurl-frontend/src/utils/crypto.ts
Normal file
7
kittyurl-frontend/src/utils/crypto.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// src/utils/crypto.ts
|
||||
export async function sha512(message: string): Promise<string> {
|
||||
const msgUint8 = new TextEncoder().encode(message);
|
||||
const hashBuffer = await crypto.subtle.digest('SHA-512', msgUint8);
|
||||
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
||||
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
||||
}
|
||||
Reference in New Issue
Block a user