Skip to content

Commit 65aa836

Browse files
authored
Merge pull request numpy#26340 from bmwoodruff/seedsequence-note
2 parents 764f17c + f623545 commit 65aa836

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
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 & 0 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

0 commit comments

Comments
 (0)