Package org.apache.sshd.common.random
Class JceRandom
- java.lang.Object
-
- org.apache.sshd.common.random.AbstractRandom
-
- org.apache.sshd.common.random.JceRandom
-
- All Implemented Interfaces:
NamedResource
,Random
public class JceRandom extends AbstractRandom
ARandom
implementation using the built-inSecureRandom
PRNG.- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAME
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
-
Constructor Summary
Constructors Constructor Description JceRandom()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fill(byte[] foo, int start, int len)
Fill part of bytes with random values.String
getName()
int
random(int n)
Returns a pseudo-random uniformly distributedint
in the half-open range [0, n).-
Methods inherited from class org.apache.sshd.common.random.AbstractRandom
toString
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
- Returns:
- The resource name
-
fill
public void fill(byte[] foo, int start, int len)
Description copied from interface:Random
Fill part of bytes with random values.- Parameters:
foo
- byte array to be filled.start
- index to start filling at.len
- length of segment to fill.
-
random
public int random(int n)
Description copied from interface:Random
Returns a pseudo-random uniformly distributedint
in the half-open range [0, n).- Parameters:
n
- The range upper limit- Returns:
- The randomly selected value in the range
-
-