Class RandomXoshiro256PlusPlus

java.lang.Object
java.util.Random
org.redisson.misc.RandomXoshiro256PlusPlus
All Implemented Interfaces:
Serializable, java.util.random.RandomGenerator

public final class RandomXoshiro256PlusPlus extends Random
Implementation of Random based on the xoshiro256** RNG. No-dependencies Java port of the original C code, which is public domain. This Java port is similarly dedicated to the public domain.

This implementation is thread-safe.

Author:
David Blackman and Sebastiano Vigna <vigna@acm.org> (original C code), Una Thompson <una@unascribed.com> (Java port), Nikita Koksharov
See Also:
  • Method Details

    • create

      public static Random create()
    • setSeed

      public void setSeed(long seed)
      Overrides:
      setSeed in class Random
    • next

      protected int next(int bits)
      Overrides:
      next in class Random
    • nextInt

      public int nextInt()
      Specified by:
      nextInt in interface java.util.random.RandomGenerator
      Overrides:
      nextInt in class Random
    • nextInt

      public int nextInt(int bound)
      Specified by:
      nextInt in interface java.util.random.RandomGenerator
      Overrides:
      nextInt in class Random
    • nextLong

      public long nextLong(long bound)
    • nextDouble

      public double nextDouble()
      Specified by:
      nextDouble in interface java.util.random.RandomGenerator
      Overrides:
      nextDouble in class Random
    • nextFloat

      public float nextFloat()
      Specified by:
      nextFloat in interface java.util.random.RandomGenerator
      Overrides:
      nextFloat in class Random
    • nextBoolean

      public boolean nextBoolean()
      Specified by:
      nextBoolean in interface java.util.random.RandomGenerator
      Overrides:
      nextBoolean in class Random
    • nextBytes

      public void nextBytes(byte[] buf)
      Specified by:
      nextBytes in interface java.util.random.RandomGenerator
      Overrides:
      nextBytes in class Random
    • nextBytes

      public void nextBytes(byte[] buf, int ofs, int len)
    • nextLong

      public long nextLong()
      Specified by:
      nextLong in interface java.util.random.RandomGenerator
      Overrides:
      nextLong in class Random