Skip to content

Commit

Permalink
feat: improve faststringhash "uniqueness"
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Aug 18, 2024
1 parent c45a5ec commit 285a077
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 285a077

Please sign in to comment.