mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-20 15:49:48 +08:00
feat: add UserLogin (#209)
This commit is contained in:
6
frontend/src/utils/index.js
Normal file
6
frontend/src/utils/index.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export const hashPassword = async (password) => {
|
||||
// user crypto to hash password
|
||||
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(password));
|
||||
const hashArray = Array.from(new Uint8Array(digest));
|
||||
return hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('');
|
||||
}
|
||||
Reference in New Issue
Block a user