Improvements to random ID generation
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 19 Dec 2009 19:23:45 +0000 (12:23 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 21 Dec 2009 18:01:13 +0000 (11:01 -0700)
framework/Mime/lib/Horde/Mime.php

index 211a229..fa79239 100644 (file)
@@ -591,7 +591,7 @@ class Horde_Mime
      */
     static public function generateRandomId($length = 24)
     {
-        return substr(base_convert(dechex(strtr(microtime(), array('0.' => '', ' ' => ''))) . uniqid(mt_rand(), true), 16, 36), $length);
+        return substr(base_convert(dechex(strtr(microtime(), array('0.' => '', ' ' => ''))) . strtr(uniqid(mt_rand(), true), array('.' => '')), 16, 36), 0, $length);
     }
 
     /**