Update sdbm-hash.md

This commit is contained in:
Christian Bender
2017-12-24 23:33:52 +01:00
committed by GitHub
parent 369ecbcd56
commit 5720135525

View File

@ -4,7 +4,7 @@ It uses the charCodeAt-methode and the shift-operator.
``` js
function sdbm(s) {
var hashCode = new Number();
var hashCode = 0;
for (var i = 0; i < s.length; i++) {
hashCode = s.charCodeAt(i) + (hashCode << 6) + (hashCode << 16) - hashCode;
}