How do I calculate a good hash code for a list of strings?

后端 未结 11 1583
我寻月下人不归
我寻月下人不归 2020-12-01 02:34

Background:

  • I have a short list of strings.
  • The number of strings is not always the same, but are nearly always of the order of a “handful”
  • I
11条回答
  •  萌比男神i
    2020-12-01 03:21

    If you happen to use Java, you can create an array of strings (or convert a collection to an array), and then use Arrays.hashCode() as documented here.

提交回复
热议问题