From 83c8698b9f8d1e348b188725ca335b34b74922c9 Mon Sep 17 00:00:00 2001 From: khtsly Date: Sat, 14 Feb 2026 00:04:36 +0700 Subject: [PATCH] rewrite(phase4): lets do 16 bits instead --- src/Util/Identifier.luau | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Util/Identifier.luau b/src/Util/Identifier.luau index 7bb0137..3fc7c84 100644 --- a/src/Util/Identifier.luau +++ b/src/Util/Identifier.luau @@ -18,20 +18,20 @@ return function(name: string): number return cached end - local h: number = 2166136261 + local h = 2166136261 + game.PlaceVersion for i = 1, #name do h = bit32.bxor(h, string.byte(name, i)) h = bit32.band(h * 16777619, 0xFFFFFFFF) end - local id = h % 254 + 2 + local id = h % 65534 + 2 local existing = used[id] if existing and existing ~= name then - warn(`[Warp] Hash collision: "{name}" & "{existing}" both map to ID {id}`) + error(`[Warp] Hash collision: "{name}" & "{existing}" both map to ID {id}. Rename one.`) end cache[name] = id used[id] = name return id -end +end \ No newline at end of file