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