Remove references to Random::DEFAULT in the documentation
* Random::DEFAULT is no longer a Random instance, and referencing it is more confusing than helpful. Related to [Feature #17351]
This commit is contained in:
parent
f7850bbea8
commit
c183288754
14
random.c
14
random.c
@ -832,8 +832,8 @@ rand_mt_get_bytes(rb_random_t *rnd, void *ptr, size_t n)
|
|||||||
* call-seq:
|
* call-seq:
|
||||||
* srand(number = Random.new_seed) -> old_seed
|
* srand(number = Random.new_seed) -> old_seed
|
||||||
*
|
*
|
||||||
* Seeds the system pseudo-random number generator, Random::DEFAULT, with
|
* Seeds the system pseudo-random number generator, with +number+.
|
||||||
* +number+. The previous seed value is returned.
|
* The previous seed value is returned.
|
||||||
*
|
*
|
||||||
* If +number+ is omitted, seeds the generator using a source of entropy
|
* If +number+ is omitted, seeds the generator using a source of entropy
|
||||||
* provided by the operating system, if available (/dev/urandom on Unix systems
|
* provided by the operating system, if available (/dev/urandom on Unix systems
|
||||||
@ -1569,8 +1569,6 @@ rb_f_rand(int argc, VALUE *argv, VALUE obj)
|
|||||||
* call-seq:
|
* call-seq:
|
||||||
* Random.rand -> float
|
* Random.rand -> float
|
||||||
* Random.rand(max) -> number
|
* Random.rand(max) -> number
|
||||||
*
|
|
||||||
* Alias of Random::DEFAULT.rand.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
@ -1646,7 +1644,7 @@ Init_RandomSeedCore(void)
|
|||||||
If failed to fill siphash's salt with random data, expand less random
|
If failed to fill siphash's salt with random data, expand less random
|
||||||
data with MT.
|
data with MT.
|
||||||
|
|
||||||
Don't reuse this MT for Random::DEFAULT. Random::DEFAULT::seed shouldn't
|
Don't reuse this MT for default_rand(). default_rand()::seed shouldn't
|
||||||
provide a hint that an attacker guess siphash's seed.
|
provide a hint that an attacker guess siphash's seed.
|
||||||
*/
|
*/
|
||||||
struct MT mt;
|
struct MT mt;
|
||||||
@ -1680,10 +1678,10 @@ rb_reset_random_seed(void)
|
|||||||
*
|
*
|
||||||
* The class method Random.rand provides the base functionality of Kernel.rand
|
* The class method Random.rand provides the base functionality of Kernel.rand
|
||||||
* along with better handling of floating point values. These are both
|
* along with better handling of floating point values. These are both
|
||||||
* interfaces to Random::DEFAULT, the Ruby system PRNG.
|
* interfaces to the Ruby system PRNG.
|
||||||
*
|
*
|
||||||
* Random.new will create a new PRNG with a state independent of
|
* Random.new will create a new PRNG with a state independent of the Ruby
|
||||||
* Random::DEFAULT, allowing multiple generators with different seed values or
|
* system PRNG, allowing multiple generators with different seed values or
|
||||||
* sequence positions to exist simultaneously. Random objects can be
|
* sequence positions to exist simultaneously. Random objects can be
|
||||||
* marshaled, allowing sequences to be saved and resumed.
|
* marshaled, allowing sequences to be saved and resumed.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user