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.
精彩评论