From ecbd5a93e4db68c437b947fdaeee578a0a21d8be Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Mon, 13 Apr 2026 20:21:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Bun.hash=20?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.ts b/build.ts index 349a21e7e..857aefe8e 100644 --- a/build.ts +++ b/build.ts @@ -145,7 +145,15 @@ if (typeof globalThis.Bun === "undefined") { function $(parts, ...args) { throw new Error("Bun.$ shell API is not available in Node.js. Use Bun runtime for this feature."); } - globalThis.Bun = { which, $ }; + function hash(data, seed) { + let h = ((seed || 0) ^ 0x811c9dc5) >>> 0; + for (let i = 0; i < data.length; i++) { + h ^= data.charCodeAt(i); + h = Math.imul(h, 0x01000193) >>> 0; + } + return h; + } + globalThis.Bun = { which, $, hash }; } import "./cli.js" `