keyUtil:
package com.duocy.util;
import java.util.Random;
public class keyUtil {
public String keyUtil() {
String str="ABCDEFGHIJKLMNOPQRSTUVWXYZqwertyuiopasdfghjklzxcvbnm0123456789";
StringBuilder st=new StringBuilder(4);
for(int i=0;i<4;i++){
char ch=str.charAt(new Random().nextInt(str.length()));
st.append(ch);
}
String findkey=st.toString().toLowerCase();
System.out.println("生成找回的key为:"+st.toString());
return findkey;
}
}
个人记录之用!