I understand that I should use os.urandom()
or SystemRandom
in Python for 'secure' pseudo-random numbers.
But how does Python generate these random numbers logically?
Also is there a way to generate a number in Python that is 'more random' than others?
For "secure" random numbers, Python doesn't actually generate them: it gets them from the operating system, which has a special driver that gathers entropy from various real-world sources, such as variations in timing between keystrokes and disk seeks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With