import java.util.UUID;
public class RamdomTool {
public static String getUUID() {
return UUID.randomUUID().toString().replace("-", "");
}
public static int getInt(int x) {
if (x<=0) {
return 0;
}
return (int)(Math.random() * (x+1));
}
public static int getInt(int x, int y) {
if (x<=0 || y <= 0 || x > y) {
return 0;
}
return (int)(Math.random() * (y - x + 1)) + x;
}
public static String getLetterString(int x) {
if (x <= 0) {
return "";
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < x; i++) {
sb.append((char) (int) (Math.random() * 26 + 97));
}
return sb.toString();
}
public static String getNumberString(int x) {
if (x <= 0) {
return "";
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < x; i++) {
sb.append((int) (Math.random() * 10));
}
return sb.toString();
}
}