Yes and…
UUIDs aren’t “just more difficult to guess.” They are inconceivably harder to guess.
> Put another way, one would need to generate 1 billion v4 UUIDs per second for 85 years to have a 50% chance of a single collision.
UUIDs aren’t “just more difficult to guess.” They are inconceivably harder to guess.
> Put another way, one would need to generate 1 billion v4 UUIDs per second for 85 years to have a 50% chance of a single collision.
def uuid4():
"""Generate a random UUID."""
return UUID(bytes=os.urandom(16), version=4)
https://github.com/python/cpython/blob/3.13/Lib/uuid.pySo there really shouldn't be anyone using that today, thankfully.