3 ms·
Uh... Come again? def uuid4(): """Generate a random UUID.""" return UUID(bytes=os.urandom(16), version=4) https://github.com/python/cpytho
by shakna 1y ago
Uh... Come again?
def uuid4():
"""Generate a random UUID."""
return UUID(bytes=os.urandom(16), version=4)
https://github.com/python/cpython/blob/3.13/Lib/uuid.py https://github.com/python/cpython/blob/3.13/Lib/uuid.py
- sergeyprokhoren 1y ago[dead]
- cobbal 1y agoNice. Looks like I was looking at an old version of the file. https://github.com/python/cpython/commit/09ba98436444d2a4e11a5d3801773bb20441a1ac https://github.com/python/cpython/commit/09ba98436444d2a4e11...
- shakna 1y agoYeah, Python went through a big shakeup around secure randomness when they put together the "secrets" library, around a decade ago. A lot of that also got backported on most OSs. So there really shouldn't be anyone using that today, thankfully.