<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.util.Random" %>
<%!
public String createRandomString() {
char ch[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
'z', '0', '1' };
Random random = new Random();
if (32 > 0) {
int index = 0;
char[] temp = new char[32];
int num = random.nextInt();
for (int i = 0; i < 32 % 5; i++) {
temp[index++] = ch[num & 63];
num >>= 6;
}
for (int i = 0; i < 32 / 5; i++) {
num = random.nextInt();
for (int j = 0; j < 5; j++) {
temp[index++] = ch[num & 63];
num >>= 6;
}
}
return new String(temp, 0, 32);
} else if (32 == 0) {
return "";
} else {
throw new IllegalArgumentException();
}
}
%>
<%
out.println(createRandomString());
%>