Package org.apache.sshd.common.random
Interface Random
-
- All Superinterfaces:
NamedResource
- All Known Implementing Classes:
AbstractRandom
,BouncyCastleRandom
,JceRandom
,SingletonRandomFactory
public interface Random extends NamedResource
A pseudo random number generator.
-
-
Field Summary
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
fill(byte[] bytes)
Fill the buffer with random valuesvoid
fill(byte[] bytes, int start, int len)
Fill part of bytes with random values.int
random(int n)
Returns a pseudo-random uniformly distributedint
in the half-open range [0, n).-
Methods inherited from interface org.apache.sshd.common.NamedResource
getName
-
-
-
-
Method Detail
-
fill
default void fill(byte[] bytes)
Fill the buffer with random values- Parameters:
bytes
- The bytes to fill- See Also:
fill(byte[], int, int)
-
fill
void fill(byte[] bytes, int start, int len)
Fill part of bytes with random values.- Parameters:
bytes
- byte array to be filled.start
- index to start filling at.len
- length of segment to fill.
-
random
int random(int n)
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
-
-