Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2564bae

Browse files
Merge pull request ryanmcdermott#19 from gsklee/patch-2
Fix error in example code
2 parents 4736752 + b7a5d73 commit 2564bae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,7 @@ function hashIt(data) {
19181918
// Loop through every character in data
19191919
for (var i = 0; i < length; i++) {
19201920
// Get character code.
1921-
var char = i.charCodeAt(i);
1921+
var char = data.charCodeAt(i);
19221922
// Make the hash
19231923
hash = ((hash << 5) - hash) + char;
19241924
// Convert to 32-bit integer
@@ -1935,7 +1935,7 @@ function hashIt(data) {
19351935
var length = data.length;
19361936

19371937
for (var i = 0; i < length; i++) {
1938-
var char = i.charCodeAt(i);
1938+
var char = data.charCodeAt(i);
19391939
hash = ((hash << 5) - hash) + char;
19401940

19411941
// Convert to 32-bit integer

0 commit comments

Comments
 (0)