UUID to unique integer id?

前端 未结 6 724
悲哀的现实
悲哀的现实 2021-01-01 08:37

I was wondering what the easiest way to convert a UUID to a unique integer would be? I have tried using the hash code but people tell me that it is not going to always be un

6条回答
  •  -上瘾入骨i
    2021-01-01 09:04

    You may convert uuid to BigInteger and keep it unique.

                  BigInteger  big = new BigInteger(uuid, 16);
    

提交回复
热议问题