Skip to content

Commit f623545

Browse files
committed
moved note up in file and added internal link. [skip azp] [skip actions] [skip cirrus]
1 parent 695b9fc commit f623545

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

doc/source/reference/random/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ pseudo-randomness was good for in the first place.
5656
or cryptographic purposes. See the :py:mod:`secrets` module from the
5757
standard library for such use cases.
5858

59+
.. _recommend-secrets-randbits:
60+
5961
Seeds should be large positive integers. `default_rng` can take positive
6062
integers of any size. We recommend using very large, unique numbers to ensure
6163
that your seed is different from anyone else's. This is good practice to ensure

doc/source/reference/random/parallel.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ These properties together mean that we can safely mix together the usual
4545
user-provided seed with simple incrementing counters to get `~BitGenerator`
4646
states that are (to very high probability) independent of each other. We can
4747
wrap this together into an API that is easy to use and difficult to misuse.
48+
Note that while `~SeedSequence` attempts to solve many of the issues related to
49+
user-provided small seeds, we still :ref:`recommend<recommend-secrets-randbits>`
50+
using :py:func:`secrets.randbits` to generate seeds with 128 bits of entropy to
51+
avoid the remaining biases introduced by human-chosen seeds.
4852

4953
.. code-block:: python
5054
@@ -97,10 +101,6 @@ streams, about :math:`2^{20}`, then the probability that at least one pair of
97101
them are identical is about :math:`2^{-88}`, which is in solidly-ignorable
98102
territory ([2]_).
99103

100-
Note that while `~SeedSequence` attempts to solve many of the issues related to
101-
user-provided small seeds, we still recommend using :py:func:`secrets.randbits` to generate
102-
seeds with 128 bits of entropy to avoid the remaining biases introduced by human-chosen seeds.
103-
104104
.. [1] The algorithm is carefully designed to eliminate a number of possible
105105
ways to collide. For example, if one only does one level of spawning, it
106106
is guaranteed that all states will be unique. But it's easier to

0 commit comments

Comments
 (0)