Files
ridebus-website/utils/hashCode.ts
2024-03-20 00:12:01 +03:00

7 lines
185 B
TypeScript

export const hashCode = function(s: string) {
var h = 0, l = s.length, i = 0;
if ( l > 0 )
while (i < l)
h = (h << 5) - h + s.charCodeAt(i++) | 0;
return h;
};