Get unique integer value from string

前端 未结 5 1759
我在风中等你
我在风中等你 2021-02-07 06:34

I have different unique strings in the same format. The string looks like this axf25!j&809>-11~dc and I want to get unique integer value from this string.

5条回答
  •  别跟我提以往
    2021-02-07 06:55

    You can't guarantee unique integer values from different strings since there are more possible string representations than integers. You can use some well known/defined hashing algorithm to minimize the chance of a collision. You should look at MD5 or SHA.

    The java class MessageDigest should be of some use.

提交回复
热议问题