Generate a unique ID

I want to make a function to generate a unique ID that is never the same. I am wondering how to make one, I want to use HttpService GUID, but it could still generate duplicates though it is extremely low. I have not found any solutions.

You could keep using GUID’s but just check if its been used before.

You do not need to worry about that. It is almost literally impossible to get the same UUID. For instance, this is the amount of possible UUIDs:
53,000,000,000,000,000,000,000,000,000,000,000

My brain cannot handle that huge number. :exploding_head:

According to my rough calculations :nerd_face: Each person in the entire world (8 billion people) can own up to 6,625,000,000,000,000,000,000,000 unique UUIDs before a repetition. If you were generating a million UUIDs every millisecond non-stop, you would take 1,680,405,800,000 millenniums or around 122657 times the age of the universe just to fill all of them.

So yes, you could get the same UUID in a row. And pigs might fly.

10 Likes

I think I will just make a datastore and see if there are the same ones. Thanks though.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.