Class SecureRandom
java.lang.Object
java.util.Random
java.security.SecureRandom
org.miaixz.bus.shade.safety.algorithm.SecureRandom
- All Implemented Interfaces:
Serializable,RandomGenerator
安全随机数
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.random.RandomGenerator
RandomGenerator.ArbitrarilyJumpableGenerator, RandomGenerator.JumpableGenerator, RandomGenerator.LeapableGenerator, RandomGenerator.SplittableGenerator, RandomGenerator.StreamableGenerator -
Constructor Summary
ConstructorsConstructorDescriptionSecureRandom(boolean intPad, byte[] value) SecureRandom(boolean intPad, byte[][] values) SecureRandom(byte[] value) SecureRandom(byte[][] values) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generateSeed(int numBytes) booleanvoidnextBytes(byte[] bytes) intnextInt()longnextLong()Methods inherited from class java.security.SecureRandom
getAlgorithm, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, reseed, reseed, setSeed, setSeed, toStringMethods inherited from class java.util.Random
doubles, doubles, doubles, doubles, from, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextDouble, nextFloat, nextGaussian, nextIntMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.random.RandomGenerator
isDeprecated, nextDouble, nextDouble, nextExponential, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
Constructor Details
-
SecureRandom
public SecureRandom(byte[] value) -
SecureRandom
public SecureRandom(byte[][] values) -
SecureRandom
public SecureRandom(boolean intPad, byte[] value) -
SecureRandom
public SecureRandom(boolean intPad, byte[][] values)
-
-
Method Details
-
nextBytes
public void nextBytes(byte[] bytes) - Specified by:
nextBytesin interfaceRandomGenerator- Overrides:
nextBytesin classSecureRandom
-
generateSeed
public byte[] generateSeed(int numBytes) - Overrides:
generateSeedin classSecureRandom
-
nextInt
public int nextInt()- Specified by:
nextIntin interfaceRandomGenerator- Overrides:
nextIntin classRandom
-
nextLong
public long nextLong()- Specified by:
nextLongin interfaceRandomGenerator- Overrides:
nextLongin classRandom
-
isExhausted
public boolean isExhausted()
-