String to Integer Hashing Function with Precision

后端 未结 4 1745
滥情空心
滥情空心 2021-01-19 10:35

I want to hash a char array in to an int or a long. The resulting value has to adhere to a given precision value. The function I\'ve been using is given below:



        
4条回答
  •  梦毁少年i
    2021-01-19 10:45

    MD5 or SHA. There are many open implementations, and the outcome is very unlikely to produce a duplicate result.

提交回复
热议问题