Package org.apache.sshd.common.random
Interface Random
- All Superinterfaces:
NamedResource
- All Known Implementing Classes:
AbstractRandom
,BouncyCastleRandom
,JceRandom
,SingletonRandomFactory
A pseudo random number generator.
-
Field Summary
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
Method Summary
Methods inherited from interface org.apache.sshd.common.NamedResource
getName
-
Method Details
-
fill
default void fill(byte[] bytes) Fill the buffer with random values- Parameters:
bytes
- The bytes to fill- See Also:
-
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
-