I am writing a message transfer program between multiple clients and server.
I want to generate a unique message ID for every message. It should be generated by the server and returned to the client.
For message transfer, I am using a hash data structure, for example:
{
api => POST,
username => sganesh,
pass => "pass",
message => "hai",
time => "current_time",
}
I want to generate a unique ID using this hash.
I have tried several approaches, MD5 and freeze but these give unreadable IDs. I want some meaningful or readable unique IDs.
I have thought we can use microseconds to differentiate between the IDs but here the problem is multiple clients.
In any situation the IDs should be unique.
Can anyone help me out of this problem?
Thanks in advance.