function jenkinsHash(str) {
for (var hash = 0, i = 0, len = str.length; i < len; ++i) {
hash += (str.charCodeAt(i) >>> 0);
hash = hash >>> 0
hash += ((hash << 10) >>> 0);
hash = hash >>> 0
hash ^= ((hash >>> 6) >>> 0);
hash = hash >>> 0
}
hash += ((hash << 3) >>> 0);
hash = hash >>> 0
hash ^= ((hash >>> 11) >>> 0);
hash = hash >>> 0
hash += ((hash << 15) >>> 0);
hash = hash >>> 0
return hash >>> 0;
}
Created
February 16, 2016 15:14
-
-
Save linuxenko/58af8c4606ac4e5cdaae to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment