From 854c02f8cb5b2bb35ad3a07dbd3a4f96c6ee5fed Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Wed, 31 Jan 2024 16:08:32 +0800 Subject: [PATCH] fix: scripts --- scripts/export-geardata.ts | 2 +- scripts/find-id.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/export-geardata.ts b/scripts/export-geardata.ts index ff9de8d..1c7f1bc 100644 --- a/scripts/export-geardata.ts +++ b/scripts/export-geardata.ts @@ -23,7 +23,7 @@ function encryptKey(uid: string) { hasher.hash(uid); const hash = hasher.result(); const key = hash & 0xff; - const encrypted = base64.encode( + const encrypted = base64.encodeBase64( new TextEncoder().encode(uid).map((i) => i ^ key), ); return { diff --git a/scripts/find-id.ts b/scripts/find-id.ts index d5fdcb6..31bb2f2 100644 --- a/scripts/find-id.ts +++ b/scripts/find-id.ts @@ -20,7 +20,7 @@ for (const file of files) { const content: FileExporterType = JSON.parse(await Deno.readTextFile(file)); if (content.type === "SUMMARY") continue; const id = content.data.detail.id; - const rawId = base64.decode(id); + const rawId = base64.decodeBase64(id); const uuid = new TextDecoder().decode(rawId.slice(rawId.length - 36)); if (ids.has(uuid)) { console.log(