public static String verificationCode() {
ArrayList<Character> list = new ArrayList<>();
for (int i = 0; i < 26; i++) {
char c = (char) ('a' + i);
char c1 = (char) ('A' + i);
list.add(c);
list.add(c1);
}
Random r = new Random();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 4; i++) {
int cc = r.nextInt(list.size());
char a = list.get(cc).charValue();
sb.append(a);
}
int numbol = r.nextInt(10);
sb.append(numbol);
char[] arr = sb.toString().toCharArray();
int index = r.nextInt(arr.length);
char temp = arr[index];
arr[index] = arr[arr.length - 1];
arr[arr.length - 1] = temp;
return new String(arr);
}