Generate unique random hash

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. $seed = 'JvKnrQWPsThuJteNQAuH';
  2. $hash = sha1(uniqid($seed . mt_rand(), true));
  4. # To get a shorter version of the hash, just use substr
  5. $hash = substr($hash, 0, 10);

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.