Skip to content

hash function example in the comment seems to be wrong. #2

@infinitylogesh

Description

@infinitylogesh

Hi ,
First of all, Thanks for the great post and commentary. The example in the word2phrase.c - getWordHash function seems wrong to me.

Line 108 in word2phrase.c

hash = ((((h * 257) + a) * 257) + t) % 30E6

i guess the correct version should be :

hash = (((((hash * 257) + h) * 257) + a)*257+t) % 30E6

Please correct me if i am wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions