Files
yaklang-chrome-extension/src/features/proxy/hash.ts
T

9 lines
269 B
TypeScript

export function hashText(value: string): string {
let hash = 0x811c9dc5;
for (let index = 0; index < value.length; index += 1) {
hash ^= value.charCodeAt(index);
hash = Math.imul(hash, 0x01000193);
}
return (hash >>> 0).toString(16).padStart(8, '0');
}