I need to generate an unspecified number of longs that are cryptographically secure have a uniform distribution and are within a given range. Will this produce what I need:
SecureRandom rand = new SecureRandom();
LongStream l = rand.longs(streamsize, randomNumberOrigin,
randomNumberBound);
long[] rands = l.toArray();
return rands;
Are there any other better methods?