I want to make a chat program, and the way I'm thinking of making it requires the use of UUIDs that are unique for the entire planet. I've put a little bit of thought into how to make one, but as I'm relatively new to the concept I thought I would ask here for advice. So far I was thinking that it could be made like this:
timestamp
dynamically created address (new int)
info in the above
ip address at the time of creation
Depends entirely on what you're using the UUID/UDID for. What's your goal with it?
Long edit:
Do you just want a temporary way to keep track of users? Do you want persistent connections? Do you want a permanent way to keep track of users? Are you opposed to usernames? Is it necessary to have UUIDs? If so, what information do you need from the users?
I need it to keep track of users - usernames will probably be supported, but the chat program is decentralized and peer to peer, so usernames are not a very good way to keep track of people (there could be independent networks that might be connected at any point in time, which could cause naming conflicts if two users registered using the same name)
Session to session. If it wasn't permanent, there would be no way to automatically find a friend's IP. If you couldn't automatically find their IP, you would have to ask them for it through some other means every time the IP changes.
There's no central database to store username/password cominations...
Maybe I should explain the system I'm thinking of. Every computer that has the program creates a UUID on first startup which it will give to friends and connections (more on connections later) to keep track of that computer's IP.
The connections I mentioned earlier are randomly selected computers that keep track of each other's IPs. If their IP changes while the other computer is off, meaning there isn't any way to update the IP, the connection is dropped and replaced. If the IP changes while the computer is on, it's updated.
IPs are kept track of for friends. Lets say you are computer A and your friend is computer B. If B's IP changes while A is off, they would normally have to exchange the new IP through some other means. But, with this system, A asks all of its connections if they or their connections know the latest IP of B. If they do, they return the new IP to A, and any exchange is no longer necessary. So, the UUID is important because otherwise there would be no reliable means to keep track of a computer's IP.