update added jwt tokens

This commit is contained in:
wt committed 2025-11-11 14:26:16 +07:00
1 parent a5e28c5533
commit b0064a9b81
25 files changed
+2004 -31

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
const hashPassword = async (password) => {
if (crypto && crypto.subtle) {
const encoder = new TextEncoder()
const data = encoder.encode(password)
const hashBuffer = await crypto.subtle.digest('SHA-256', data)
const hashArray = Array.from(new Uint8Array(hashBuffer))
const hashHex = hashArray.map(b=>('00' + b.toString(16)).slice(-2)).join('')
return hashHex
}
return CryptoJS.SHA256(password).toString()
}