From 285a07771205e759d4c0b02161acccc20be11ec9 Mon Sep 17 00:00:00 2001 From: Dwynr Date: Sun, 18 Aug 2024 04:30:19 +0200 Subject: [PATCH] feat: improve faststringhash "uniqueness" --- package.json | 2 +- src/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ed2d0e2f..8a0d2e23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@filen/sdk", - "version": "0.1.152", + "version": "0.1.153", "description": "Filen SDK", "main": "dist/node/index.js", "browser": "dist/browser/index.js", diff --git a/src/utils.ts b/src/utils.ts index 91675b72..dee7f740 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -288,7 +288,7 @@ export function replacePathStartWithFromAndTo(path: string, from: string, to: st } export function fastStringHash(input: string): string { - return xxHash32(input, xxHash32(input)).toString(16) + return input.substring(0, 4) + xxHash32(input, xxHash32(input)).toString(16) + input.substring(input.length - 4, input.length) } export const utils = {