From 0dca37f035e74a5055ab735665a0fd4a4c233319 Mon Sep 17 00:00:00 2001 From: MasterGordon Date: Fri, 18 Oct 2024 18:12:18 +0200 Subject: [PATCH] fixed hash shit --- shared/utils.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/shared/utils.ts b/shared/utils.ts index 9e99651..0df594c 100644 --- a/shared/utils.ts +++ b/shared/utils.ts @@ -3,21 +3,6 @@ export const pickRandom = (arr: T[]) => { return arr[index]; }; -function bashHashStr(str: string) { - let hash = 5381, - i = str.length; - - while (i) { - hash = (hash * 33) ^ str.charCodeAt(--i); - } - - return hash >>> 0; -} - -export const hashStr = (str: string) => { - return Number(`0.${bashHashStr(str)}`); -}; - export const weightedPickRandom = ( arr: T[], getWeight: (item: T) => number = () => 1,