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

    Modifier and Type
    Method
    Description
    default void
    fill(byte[] bytes)
    Fill the buffer with random values
    void
    fill(byte[] bytes, int start, int len)
    Fill part of bytes with random values.
    int
    random(int n)
    Returns a pseudo-random uniformly distributed int in the half-open range [0, n).

    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 distributed int in the half-open range [0, n).
      Parameters:
      n - The range upper limit
      Returns:
      The randomly selected value in the range