mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-11 22:51:05 +00:00
7 lines
189 B
TypeScript
7 lines
189 B
TypeScript
export function hashString(value: string): number {
|
|
let hash = 0
|
|
for (let i = 0; i < value.length; i++) {
|
|
hash = (Math.imul(31, hash) + value.charCodeAt(i)) | 0
|
|
}
|
|
return hash >>> 0
|
|
}
|