随机字符串(数字及字母)
public static String randomString(int length) {
String baseString = "1357924680ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
StringBuilder sb = new StringBuilder(length);
int baseLength = baseString.length();
for(int i = 0; i < length; ++i) {
int number = randomInt(baseLength);
sb.append(baseString.charAt(number));
}
return sb.toString();
}
UUID工具类,JAVA自带的和hutool的UUID