This commit is contained in:
Alexey Kasyanchuk
2018-08-08 23:55:47 +03:00
parent 34cdc7fb09
commit ce618f4408
17 changed files with 67 additions and 66 deletions

View File

@ -21,9 +21,9 @@ const stringHashCode = (str) => {
if (str.length === 0)
return hash;
for (i = 0; i < str.length; i++) {
chr = str.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
chr = str.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
return hash;
};