How to generate a unique hash code for string input in android…?

前端 未结 8 508
迷失自我
迷失自我 2020-12-13 03:41

I wanted to generate a unique hash code for a string in put in android. Is there any predefined library is there or we have to generate manually. Please any body if knows pl

8条回答
  •  独厮守ぢ
    2020-12-13 04:15

    For me it worked

       public static long getUniqueLongFromString (String value){
           return  UUID.nameUUIDFromBytes(value.getBytes()).getMostSignificantBits();
        }
    

提交回复
热议问题