Skip to content
Advertisement

Tag: random

How can I create an Array in Descending Order?

I’m working on this project using Arrays. I have a method called createRandomIntArray that creates an array. This method is meant to return the Array in descending order. I have been able to do just that but I want to know if there is a more effective way to write this method than the way I wrote it. I have

Is SecureRandom weaken when seed with Random?

Could a seed from java.util.Random for java.security.SecureRandom weaken the cryptographically strong random number generator? I saw this code and wonder why this is done in that specific way. From the documentation, the call of setSeed will never reduce randomness. So why is setSeed called anyway? public void setSeed(long seed) Reseeds this random object, using the eight bytes contained in the

Advertisement