1.1.73: open-source local-lab only; drop skills and knowledge base.

This commit is contained in:
叫我小杨同学 committed 2026-10-23 15:55:53 +08:00
commit 2b6487c69c
95 files changed
+54050

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import { createCipheriv, createHash, randomBytes } from "node:crypto";
import { deflateSync } from "node:zlib";
const MIX = Object.freeze([
"cordis.slot.v2",
[100, 115, 104, 45, 112, 117, 114, 103, 101].map((n) => String.fromCharCode(n)).join(""),
"surface:web|desktop",
"ov.table.1",
]);
export function mixKey(extra) {
return createHash("sha256").update(`${MIX.join("\x1e")}\x1e${String(extra || "")}`).digest();
}
export function sealSlot(text) {
const mask = randomBytes(16).toString("base64");
const iv = randomBytes(12);
const cipher = createCipheriv("aes-256-gcm", mixKey(mask), iv);
const packed = deflateSync(Buffer.from(String(text ?? ""), "utf8"), { level: 9 });
const body = Buffer.concat([cipher.update(packed), cipher.final()]);
return {
SLOT: body.toString("base64"),
MASK: mask,
TAG: cipher.getAuthTag().toString("base64"),
IV: iv.toString("base64"),
};
}