Posted By

lajevardi on 03/04/09


Tagged

hash


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Nix


Generating random hash


 / Published in: PHP
 

I'm using this to send verification emails.

  1. function generateHash(){
  2. $result = "";
  3. $charPool = '0123456789abcdefghijklmnopqrstuvwxyz';
  4. for($p = 0; $p<15; $p++)
  5. $result .= $charPool[mt_rand(0,strlen($charPool)-1)];
  6. return sha1(md5(sha1($result)));
  7. }

Report this snippet  

You need to login to post a comment.