How can I generate a unique ID using a hash in Perl?

Posted by sganesh on Stack Overflow See other posts from Stack Overflow or by sganesh
Published on 2010-03-18T06:52:47Z Indexed on 2010/03/18 15:11 UTC
Read the original article Hit count: 257

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about perl

Related posts about uniqueidentifier