Class JCERandom

  • All Implemented Interfaces:
    Random

    public class JCERandom
    extends java.lang.Object
    implements Random
    A Random implementation using the built-in SecureRandom PRNG.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JCERandom.Factory
      Named factory for the JCE Random
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.slf4j.Logger logger  
      private java.security.SecureRandom random  
      private byte[] tmp  
    • Constructor Summary

      Constructors 
      Constructor Description
      JCERandom()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void fill​(byte[] bytes)
      Fill the array of bytes with random values.
      void fill​(byte[] foo, int start, int len)
      Fill the given byte-array with random bytes from this PRNG.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • tmp

        private byte[] tmp
      • random

        private final java.security.SecureRandom random
    • Constructor Detail

      • JCERandom

        JCERandom()
    • Method Detail

      • fill

        public void fill​(byte[] foo,
                         int start,
                         int len)
        Fill the given byte-array with random bytes from this PRNG.
        Specified by:
        fill in interface Random
        Parameters:
        foo - the byte-array
        start - the offset to start at
        len - the number of bytes to fill
      • fill

        public void fill​(byte[] bytes)
        Description copied from interface: Random
        Fill the array of bytes with random values.
        Specified by:
        fill in interface Random
        Parameters:
        bytes - byte array to be filled.