use 31 instead of 33

pull/670/head
Rich Harris 8 years ago
parent 7a877b5857
commit d622bc3e47

@ -3,6 +3,6 @@ export default function hash(str: string): number {
let hash = 5381;
let i = str.length;
while (i--) hash = ((hash << 5) + hash) ^ str.charCodeAt(i);
while (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
return hash >>> 0;
}

@ -27,7 +27,7 @@ export function hash(str) {
var hash = 5381;
var i = str.length;
while (i--) hash = ((hash << 5) + hash) ^ str.charCodeAt(i);
while (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
return hash >>> 0;
}

Loading…
Cancel
Save