Answer the question
In order to leave comments, you need to log in
How to generate a 14 digit positive number?
How to generate a 14 digit positive number?
Answer the question
In order to leave comments, you need to log in
If you need long ones (let's say 100-digit ones), then it can be costly like this (example for 14-digit ones):
BigInteger b;
do{
b = new BigInteger(48, new SecureRandom());
} while (b.toString().length()!=14);
System.out.println(b.toString());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question