From b2f30918264cb67abcd64c3bb1e940b304424ecc Mon Sep 17 00:00:00 2001 From: Rijk van Zanten Date: Thu, 4 Nov 2021 20:21:39 -0400 Subject: [PATCH] Prevent negative hashes from being generated (#9501) Fixes #9499 --- api/src/utils/get-simple-hash.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/utils/get-simple-hash.ts b/api/src/utils/get-simple-hash.ts index 29c172ee91..0e90ead32f 100644 --- a/api/src/utils/get-simple-hash.ts +++ b/api/src/utils/get-simple-hash.ts @@ -9,5 +9,5 @@ export function simpleHash(str: string) { hash = 31 * hash + str.charCodeAt(i++); } - return hash.toString(16); + return Math.abs(hash).toString(16); }