QUOTE(dineeshd @ 16 Sep, 2008 - 02:31 AM)

Need more explanation and post the code you have so far (if you have).
thnx for your fasrt reply
I already made this method... It works well but sometimes it gives me an exception which is as I remembered " the output must be positive " I think that the code generate negative output ... here is my code
public String generateRandomText() {
final Random random = new Random(System.currentTimeMillis());
byte len = 10;
byte[] buf = new byte[len * 2];
char[] text = new char[len];
int c = 0;
while (c < text.length) {
random.nextBytes(buf);
for (byte b : buf) {
if ((b >= 'a' && b <= 'z' || (b >= 'A' && b <= 'Z')) && b != 'O' && b != 'o' && b != 'l' && b != 'L' && b != 'i' && b != 'I') {
text[c++] = (char) b;
if (c >= text.length) {
break;
}
}
}
}
String f_string = new String(text).toLowerCase();
String S_string = f_string.substring(1, 5);
String t_string = f_string.substring(7, 9);
int ran = random.nextInt(100);
String final_string = random.nextInt(ran) + S_string + random.nextInt(ran) + t_string;
System.out.println("Random activation key: " + final_string.toLowerCase());
return final_string.toLowerCase();
}