开发者

Generating unique id

开发者 https://www.devze.com 2023-03-08 06:32 出处:网络
I was looking for information about how to generate unique no in java which I can give to customer so that they can use this no to track back their info? At the same time it should not be easily guess

I was looking for information about how to generate unique no in java which I can give to customer so that they can use this no to track back their info? At the same time it should not be easily guessable. I want to implemen开发者_开发百科t this in java and in cluster envt. Thanks


You could try some sort of GUID ... i.e. http://download.oracle.com/javase/1,5.0/docs/api/java/util/UUID.html


Generate a long as always counting upwards. Make a xor with a constant key value. The result is unique, too.

0

精彩评论

暂无评论...
验证码 换一张
取 消