I\'m working on a project with a friend where we need to generate a random hash. Before we had time to discuss, we both came up with different approaches and because they are us
The second solution clearly has more entropy than the first. Assuming the quality of the source of the random bits would be the same for os.urandom
and random.random
:
More importantly, the quality of the randomness coming from os.urandom
is expected and documented to be much better than the randomness coming from random.random
. os.urandom
's docstring says "suitable for cryptographic use".