Package org.teavm.classlib.java.security
Class TSecureRandom
java.lang.Object
org.teavm.classlib.java.lang.TObject
org.teavm.classlib.java.util.TRandom
org.teavm.classlib.java.security.TSecureRandom
- All Implemented Interfaces:
TSerializable
,TRandomGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
generateSeed
(int numBytes) static TSecureRandom
getInstance
(String algorithm) static byte[]
getSeed
(int numBytes) protected int
next
(int bits) void
nextBytes
(byte[] bytes) double
float
int
nextInt()
int
nextInt
(int n) long
nextLong()
void
reseed()
void
setSeed
(byte[] seed) void
setSeed
(long seed) Methods inherited from class org.teavm.classlib.java.util.TRandom
nextGaussian
Methods inherited from class org.teavm.classlib.java.lang.TObject
clone, equals, equals0, finalize, getClass0, hashCode, notify0, notifyAll0, toString, wait0, wait0, waitImpl
Methods inherited from interface org.teavm.classlib.java.util.random.TRandomGenerator
doubles, doubles, doubles, doubles, ints, ints, ints, ints, isDeprecated, longs, longs, longs, longs, nextBoolean, nextDouble, nextDouble, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
Constructor Details
-
TSecureRandom
public TSecureRandom() -
TSecureRandom
public TSecureRandom(byte[] seed)
-
-
Method Details
-
getInstance
- Throws:
TNoSuchAlgorithmException
-
getAlgorithm
-
setSeed
public void setSeed(long seed) -
setSeed
public void setSeed(byte[] seed) -
reseed
public void reseed() -
next
protected int next(int bits) -
nextBytes
public void nextBytes(byte[] bytes) -
nextInt
public int nextInt()- Specified by:
nextInt
in interfaceTRandomGenerator
- Overrides:
nextInt
in classTRandom
-
nextInt
public int nextInt(int n) - Specified by:
nextInt
in interfaceTRandomGenerator
- Overrides:
nextInt
in classTRandom
-
nextLong
public long nextLong()- Specified by:
nextLong
in interfaceTRandomGenerator
- Overrides:
nextLong
in classTRandom
-
nextFloat
public float nextFloat()- Specified by:
nextFloat
in interfaceTRandomGenerator
- Overrides:
nextFloat
in classTRandom
-
nextDouble
public double nextDouble()- Specified by:
nextDouble
in interfaceTRandomGenerator
- Overrides:
nextDouble
in classTRandom
-
getSeed
public static byte[] getSeed(int numBytes) -
generateSeed
public byte[] generateSeed(int numBytes)
-