Last active
November 17, 2017 08:52
-
-
Save kvanbere/6f871314e0f24364d8bde34b7b7ab849 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasher(str) { | |
return Array | |
.from(str) | |
//.slice(0, 10) | |
.reduce(function(acc, i) { | |
return 0xffffffff & ((acc << 5) - acc) + i.charCodeAt(0); }, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment