[ 
https://issues.apache.org/jira/browse/RNG-19?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16921011#comment-16921011
 ] 

Gilles commented on RNG-19:
---------------------------

bq. pass all output from Random

Can be; but what is the added value?

bq. [...] the only new methods are [...]

The proposed alternative avoids code duplication.

bq. [...] only pass through the 32-bit int output. This may not be the primary 
output.

The {{Random}} API 
[requires|https://docs.oracle.com/javase/8/docs/api/java/util/Random.html#next-int-]
 subclasses to implement
{code}
protected int next(int)
{code}
which generates at most (exactly?) 32-bits per call.

bq. not be able to support save/restore without knowing how the input Random 
was created. 

Why?  State can be recovered from the serialized form.

Wrt synchronization, inheriting from {{BaseProvider}} does not change your 
conclusion (depends on the delegate's implementation.
Anyways, {{UniformRandomProvider}} being an interface, it cannot make such a 
promise to callers.

> System generator (/dev/random)
> ------------------------------
>
>                 Key: RNG-19
>                 URL: https://issues.apache.org/jira/browse/RNG-19
>             Project: Commons RNG
>          Issue Type: Wish
>            Reporter: Emmanuel Bourg
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Commons RNG could include a random number generator based on the output of 
> /dev/random or /dev/urandom on Unix systems.
> Commons Crypto has an implementation that could be used as a starting point:
> https://github.com/apache/commons-crypto/blob/master/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to