Possible Duplicate:
How to generate a random BigInteger value in Java?
I'm using BigInteger class in JAVA, and I want to generate random numbers from 1 to x-1
. I'm not sure how to do that?
I cannot use nextInt()
since it only accepts int
not BigIntegers
also, I'll be generating 32bit and above numbers so, even nextInt()
will not work.
I know If I search I may find some helpful solutions, but I'm so short in time. (2 hours before deadline)
Thanks in Advance.