Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function unique_id($length) {
- $rnd1 = mt_rand(0,10000);
- $rnd2 = mt_rand(0,10000);
- $rnd3 = mt_rand(0,10000);
- $hash = str_shuffle(sha1($rnd1).md5(microtime()).sha1($rnd2.microtime()).md5($rnd3));
- return substr($hash, 0, $length);
- }
- /**
- * whoi, lets give feedback and
- * show us some random-ids with
- * a seckey / imploded with ; /
- */
- $qnt = 40;
- for($i = 0; $i < $qnt; $i++) {
- echo implode(';',array(
- unique_id(20),
- unique_id(8),
- ));
- echo '<br />';
- }
- /** reult:
- * 2ccf5e17999e0550c263;79ea79d7
- * 9a50a23399b0a8e19d5e;099fb725
- * f90a2d5b75f8.1deb8fd;3773061c
- * 8ee9c480f5006334.cb5;e4f8048e
- * 4f1f12a29b5c592e0a9b;4 f20d7a
- * 4019620d0853cff290.7;058823d4
- * abdb1681718bcd6859e1;5066.040
- * 412df0f70f51b98efdc9;f583c0f7
- * 692e85693fab3345a1e0;c0e22c1e
- * e450f8879563d30aa472;42dc1197
- * ..and so on..
- * 1st row:
- * unique-id: 2ccf5e17999e0550c263
- * secKey: 79ea79d7
- **/
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement