I want to give my user a unique ID that is ten digits long and randomized. I was previously using:
user.guid = str(uuid.uuid4()).replace('-','')
'5d2f251a32ed437689e7d66575aee09f'
However, I also want to make it a bit easier to 'type in', as there some places where that is required. I was thinking about doing:
>>> str(uuid.uuid4()).replace('-','')[:10].upper()
'AA6560AB32'
What are the chances that there is a collision on this? And is there a better way to guarantee uniqueness (without storing previously added IDs)?