Skip to content

Commit

Permalink
Bug correction in FNV-1a hash function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tessil committed May 7, 2017
1 parent 6f53842 commit e391d0c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/array_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ struct str_hash {

std::size_t hash = init;
for (std::size_t i = 0; i < key_size; ++i) {
hash = (hash ^ key[i]) + (hash * multiplier);
hash ^= key[i];
hash *= multiplier;
}

return hash;
Expand Down

0 comments on commit e391d0c

Please sign in to comment.