fix: scripts
parent
bd569c1c80
commit
854c02f8cb
|
|
@ -23,7 +23,7 @@ function encryptKey(uid: string) {
|
||||||
hasher.hash(uid);
|
hasher.hash(uid);
|
||||||
const hash = hasher.result();
|
const hash = hasher.result();
|
||||||
const key = hash & 0xff;
|
const key = hash & 0xff;
|
||||||
const encrypted = base64.encode(
|
const encrypted = base64.encodeBase64(
|
||||||
new TextEncoder().encode(uid).map((i) => i ^ key),
|
new TextEncoder().encode(uid).map((i) => i ^ key),
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ for (const file of files) {
|
||||||
const content: FileExporterType = JSON.parse(await Deno.readTextFile(file));
|
const content: FileExporterType = JSON.parse(await Deno.readTextFile(file));
|
||||||
if (content.type === "SUMMARY") continue;
|
if (content.type === "SUMMARY") continue;
|
||||||
const id = content.data.detail.id;
|
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));
|
const uuid = new TextDecoder().decode(rawId.slice(rawId.length - 36));
|
||||||
if (ids.has(uuid)) {
|
if (ids.has(uuid)) {
|
||||||
console.log(
|
console.log(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue