title: Avoiding hash collision in php when using sha1 for hashing
body: <p>Suppose i assume if hash collision occur while i am using sha1 function in php .</p>
  
  <p>Will this code avoids it permanently or do i have to use any other way</p>
  
  <pre><code>$filename=sha1($filename.'|'.microtime());
  
  OR
  
  $filename=sha1($filename.'|'.rand());
  </code></pre>
  
  <p>If no this code doesn't provide protection from hash collision .</p>
  
  <p>What should i do to avoid any type of hash collision if i assume there can be more than 100,000 entries in db.</p>