diff --git a/assets/modules/analytics.js b/assets/modules/analytics.js index 0fa2079..be8b6de 100644 --- a/assets/modules/analytics.js +++ b/assets/modules/analytics.js @@ -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 {