From 27fb04b58ed65ae5db8f267ca4380193d9281bd3 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 7 Jan 2009 22:07:57 -0700 Subject: [PATCH] Slightly shorter random ID. --- framework/Mime/lib/Horde/Mime.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } /** -- 2.11.0