From 8663ee96c790899919295891e4c3db8c45e5be97 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 8 Aug 2025 11:20:59 +0300 Subject: [PATCH] Fix for new Panda --- incremental/common/src/sha1.ts | 4 ++-- incremental/common/src/stringUtils.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/incremental/common/src/sha1.ts b/incremental/common/src/sha1.ts index 189be4764..ad4ec9bfd 100644 --- a/incremental/common/src/sha1.ts +++ b/incremental/common/src/sha1.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { CustomTextDecoder, float64toInt32 } from "@koalaui/compat" +import { CustomTextDecoder, float64toInt32, int64to32 } from "@koalaui/compat" import { int32 } from "@koalaui/compat" const K = [ @@ -180,7 +180,7 @@ export class SHA1Hash { _byte[index++] = 0x80 | (code & 0x3F) surrogate = 0 } else { - surrogate = code + surrogate = int64to32(code) } } diff --git a/incremental/common/src/stringUtils.ts b/incremental/common/src/stringUtils.ts index f92507d69..439460fe0 100644 --- a/incremental/common/src/stringUtils.ts +++ b/incremental/common/src/stringUtils.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { int32, float64toInt32 } from "@koalaui/compat" +import { float64toInt32, int32, int64to32 } from "@koalaui/compat" /** @@ -22,8 +22,7 @@ import { int32, float64toInt32 } from "@koalaui/compat" export function hashCodeFromString(value: string): int32 { let hash = 5381 for(let i = 0; i < value.length; i++) { - hash = (hash * 33) ^ float64toInt32(value.charCodeAt(i)) - hash |= 0 + hash = int64to32((hash * 33) ^ float64toInt32(value.charCodeAt(i))) } return hash } -- Gitee