生成6位随机数
// 生成6位随机数 邀请码
public static String randomNumber(){
6位随机数
int length = 6;
StringBuffer sb = new StringBuffer();
String ALLCHAR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
Random random = new Random();
for (int i = 0; i < length; i++) {
sb.append(ALLCHAR.charAt(random.nextInt(ALLCHAR.length())));
}
return sb.toString();
}