Skip to content

Commit

Permalink
issue_10: Fixing issue reported in perezd#10
Browse files Browse the repository at this point in the history
  • Loading branch information
guloic committed Feb 27, 2021
1 parent 7a15d5e commit ec5494e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion murmurhash.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@
h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;
h1 ^= h1 >>> 16;

return h1 >>> 0;
h1 = h1 >>> 0;

if (h1 & 0x80000000 == 0) {
return h1;
}
else {
return -( (h1 ^ 0xFFFFFFFF) + 1 )
}
}

var murmur = MurmurHashV3;
Expand Down

0 comments on commit ec5494e

Please sign in to comment.