From: Michael M Slusarz Date: Thu, 8 Jan 2009 05:07:57 +0000 (-0700) Subject: Slightly shorter random ID. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=27fb04b58ed65ae5db8f267ca4380193d9281bd3;p=horde.git Slightly shorter random ID. --- diff --git a/framework/Mime/lib/Horde/Mime.php b/framework/Mime/lib/Horde/Mime.php index eef26db2a..a0dcfa062 100644 --- a/framework/Mime/lib/Horde/Mime.php +++ b/framework/Mime/lib/Horde/Mime.php @@ -477,9 +477,9 @@ class Horde_Mime * * @return string A random string. */ - static public function generateRandomId() + static public function generateRandomId($length = 24) { - return base_convert(dechex(strtr(microtime(), array('0.' => '', ' ' => ''))) . uniqid(mt_rand(), true), 16, 36); + return substr(base_convert(dechex(strtr(microtime(), array('0.' => '', ' ' => ''))) . uniqid(mt_rand(), true), 16, 36), $length); } /**