The uuid module from the Python basic library offers a fast and simple method to produce widely special IDs (UUIDs).
import uuid user_id = uuid. uuid4 ()
print (user_id )
This develops a 128-bit random number that will likely be special.
In reality, there are more than ²¹²² possible UUIDs that can be created. That’s more than 5,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.
The likelihood of discovering duplicates in an offered set is incredibly low. Even with a trillion UUIDs, the likelihood of a replicate is much less, much less than that in a billion.
Sufficient for simply 2 lines of code.