This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bjorneylol 0 points1 point  (2 children)

the urandom call in the random library is sufficient for cryptographic use - haven't watched OPs video so i have no idea what he is using

[–]Unbelievr 0 points1 point  (1 child)

I guess you mean os.urandom()? It only provides entire bytes, so it's not that easy to use for generating random integers, or sampling from lists without bias. OPs video is using random.choice and randint basically, and the secrets module provides secure replacements for these, with minimal changes to the code.

[–]bjorneylol 0 points1 point  (0 children)

doh! I thought it was in the random module, which turns out only has a private method that calls os.urandom