first commit
This commit is contained in:
7
utils/hashCode.ts
Normal file
7
utils/hashCode.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user