Java
2
Вклад в тег
public static BigInteger generateBigInteger(int length, Random random) {
StringBuilder builder = new StringBuilder(length);
builder.append(random.nextInt(9) + 1);
for (int i = 1; i < length; i++) {
builder.append(random.nextInt(10));
}
return new BigInteger(builder.toString());
}