This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients christian.heimes, mosquito, rhettinger, serhiy.storchaka
Date 2021-10-21.18:29:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634840964.88.0.522272597141.issue45556@roundup.psfhosted.org>
In-reply-to
Content
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)
History
Date User Action Args
2021-10-21 18:29:24christian.heimessetrecipients: + christian.heimes, rhettinger, serhiy.storchaka, mosquito
2021-10-21 18:29:24christian.heimessetmessageid: <1634840964.88.0.522272597141.issue45556@roundup.psfhosted.org>
2021-10-21 18:29:24christian.heimeslinkissue45556 messages
2021-10-21 18:29:24christian.heimescreate