Message157755
> However, I'm not sure of the legitimacy of replacement suitable for
> cryptographic use `os.urandom` on fast pseudo-random
> `random.getrandbits`. Especially for applications that need to generate
> a lot of uuids.
Agreed. urandom() is supposed to incorporate "real" random, while getrandbits() uses a PRNG.
Also, as the OP shows, it's easy to inject your own random source:
>>> grb = "uuid.UUID(int=random.getrandbits(128), version=4)"
if you really need the speed. |
|
Date |
User |
Action |
Args |
2012-04-07 20:06:38 | pitrou | set | recipients:
+ pitrou, rhettinger, terry.reedy, vstinner, mattchaput, serhiy.storchaka |
2012-04-07 20:06:38 | pitrou | set | messageid: <1333829198.88.0.940789027985.issue12986@psf.upfronthosting.co.za> |
2012-04-07 20:06:38 | pitrou | link | issue12986 messages |
2012-04-07 20:06:38 | pitrou | create | |
|