安全随机数生成方法

安全随机数生成方法

方法1:
SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); 	
System.out.println(random.nextLong());



方法2:
SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); 
byte[] seed= random.generateSeed(10);  
random.setSeed(seed);		
System.out.println(random.nextLong());








你可能感兴趣的:(SecureRandom)