For generating random alpha-numeric string you can use following Apache class
org.apache.commons.lang.RandomStringUtils
String r = RandomStringUtils.randomAlphanumeric(32); // for 32 random alpha-numeric sequence
similarly, you can get whatever sequence you want.
For more details about the org.apache.commons.lang.RandomStringUtils class visit this link:
http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/RandomStringUtils.html
0 comments:
Post a Comment