How can I generate a unique ID using a hash in Perl?
- by sganesh
I doing message transfer program between multiple clients and server.
I want to generate unique message id for every messages. that should be generated by server and return to client.
For message transfer I am using hash data structure,
Ex:
{
api => POST,
username => sganesh,
pass => "pass",
message => "hai",
time => "current_time",
}
I want to generate unique id using this hash.
I have tried some of the ways,
MD5 and freeze but this give unreadable id. I want some meaningful or readable unique id.
I have thought we can use micro seconds to differentiate the id but here the problem is multiple clients.
In any situation my id should be unique.
Can anyone help me out of this problem?
Thanks in Advance.