On Mon, Jun 29, 2020 at 11:30 AM Robert Kern <robert.k...@gmail.com> wrote:

> On Mon, Jun 29, 2020 at 11:10 AM Kevin Sheppard <
> kevin.k.shepp...@gmail.com> wrote:
>
>>
>>    1. The total number of digits in the binary representation is
>>    somewhere between 32 and 128.
>>
>>
> I like using the standard library `secrets` module.
>
> >>> import secrets
> >>> secrets.randbelow(1<<128)
> 8080125189471896523368405732926911908
>
> If you want an easy-to-follow rule, just use the above snippet to get a
> 128-bit number. More than 128 bits won't do you any good (at least by
> default, the internal bottleneck inside of SeedSequence is a 128-bit pool),
> and 128-bit numbers are just about small enough to copy-paste comfortably.
>

Sorry, `secrets.randbits(128)` is the cleaner form of this.

-- 
Robert Kern
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to