Replace charCodeAt with codePointAt in analytics module
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ const SK_HASH = '_h'
|
||||
let encKey = null
|
||||
|
||||
async function importKey(b64) {
|
||||
const raw = Uint8Array.from(globalThis.atob(b64), c => c.charCodeAt(0))
|
||||
const raw = Uint8Array.from(globalThis.atob(b64), c => c.codePointAt(0))
|
||||
return globalThis.crypto.subtle.importKey('raw', raw, 'AES-GCM', false, ['encrypt', 'decrypt'])
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ async function encrypt(data) {
|
||||
|
||||
async function decrypt(b64) {
|
||||
if (!encKey) return null
|
||||
const raw = Uint8Array.from(globalThis.atob(b64), c => c.charCodeAt(0))
|
||||
const raw = Uint8Array.from(globalThis.atob(b64), c => c.codePointAt(0))
|
||||
const iv = raw.slice(0, 12)
|
||||
const data = raw.slice(12)
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user