开发者

Generating unique id

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜