Class AnuQuantumSeedClient

  • All Implemented Interfaces:
    SeedGenerator, Serializable

    public class AnuQuantumSeedClient
    extends WebSeedClient
    API client for the Australian National University's quantum RNG, which extracts randomness from quantum-vacuum fluctuations. Unlike random.org, this API has no usage quotas; the generator produces 5.7 Gbps, so the output rate is limited only by network bandwidth.
    See Also:
    Serialized Form
    • Constructor Detail

      • AnuQuantumSeedClient

        public AnuQuantumSeedClient()
    • Method Detail

      • getMaxRequestSize

        protected int getMaxRequestSize()
        Description copied from class: WebSeedClient
        Returns the maximum number of bytes that can be obtained with one request to the service. When a seed larger than this is needed, it is obtained using multiple requests.
        Specified by:
        getMaxRequestSize in class WebSeedClient
        Returns:
        the maximum number of bytes per request
      • downloadBytes

        protected void downloadBytes​(HttpURLConnection connection,
                                     byte[] seed,
                                     int offset,
                                     int length)
                              throws IOException
        Description copied from class: WebSeedClient
        Performs a single request for random bytes.
        Specified by:
        downloadBytes in class WebSeedClient
        Parameters:
        connection - the connection to download from
        seed - the array to save them to
        offset - the first index to save them to in the array
        length - the number of bytes to download
        Throws:
        IOException - if a connection error occurs