A better random number generator
[java]
import java.security.SecureRandom;
…
public static SecureRandom random = null;
static {
try {
random = SecureRandom.getInstance(“SHA1PRNG”);
random.setSeed( random.generateSeed(256) );
} catch( Exception e ) {
e.printStackTrace();
}
}
[/java]
Leave a Reply