41 lines
1.3 KiB
Java
41 lines
1.3 KiB
Java
package o;
|
|
|
|
import java.util.Random;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public final class gjF {
|
|
private static final Random d = new Random();
|
|
|
|
public static String a(int i) {
|
|
Random random = d;
|
|
if (i == 0) {
|
|
return "";
|
|
}
|
|
if (i < 0) {
|
|
StringBuilder sb = new StringBuilder("Requested random string length ");
|
|
sb.append(i);
|
|
sb.append(" is less than 0.");
|
|
throw new IllegalArgumentException(sb.toString());
|
|
}
|
|
StringBuilder sb2 = new StringBuilder(i);
|
|
while (true) {
|
|
int i2 = i - 1;
|
|
if (i != 0) {
|
|
int nextInt = random.nextInt(91) + 32;
|
|
int type = Character.getType(nextInt);
|
|
if (type != 0 && type != 18 && type != 19) {
|
|
int charCount = Character.charCount(nextInt);
|
|
if (i2 != 0 || charCount <= 1) {
|
|
if (Character.isLetter(nextInt) || Character.isDigit(nextInt)) {
|
|
sb2.appendCodePoint(nextInt);
|
|
i = charCount == 2 ? i - 2 : i2;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
return sb2.toString();
|
|
}
|
|
}
|
|
}
|
|
}
|