Message404631
We use os.urandom() because it is backed by a cryptographicly secure random number generator. The random module uses a non-secure RNG. While RFC 4122 does not mandate a CSRPNG, application often rely on unpredictable UUIDs. Correctness and security is more important here than performance.
If you need a faster uuid4 implementation, then you can role your own with a couple of lines of code:
import random
from uuid import UUID
def uuid4_fast():
return UUID(int=random.getrandbits(128), version=4) |
|
Date |
User |
Action |
Args |
2021-10-21 18:29:24 | christian.heimes | set | recipients:
+ christian.heimes, rhettinger, serhiy.storchaka, mosquito |
2021-10-21 18:29:24 | christian.heimes | set | messageid: <1634840964.88.0.522272597141.issue45556@roundup.psfhosted.org> |
2021-10-21 18:29:24 | christian.heimes | link | issue45556 messages |
2021-10-21 18:29:24 | christian.heimes | create | |
|