Choosing a multiplier for a (string) hash function

后端 未结 3 2062
小鲜肉
小鲜肉 2021-02-05 14:03

Do you have any advice/rules on selecting a multiplier to use in a (multiplicative) hash function. The function is computing the hash value of a string.

3条回答
  •  名媛妹妹
    2021-02-05 14:29

    Historically 33 seems like a popular choice, and it tends to work pretty well. No one knows why though. For more details, look here

提交回复
热议问题