summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/random.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2012-04-01 12:39:48 -0700
committerBharat Mediratta <bharat@menalto.com>2012-04-01 12:39:48 -0700
commitcd46dc479cf975cbb843c360f1240203aebfcb32 (patch)
tree62218b3233198bacaab3e0dc7996f707515c8a9d /modules/gallery/helpers/random.php
parentb9d7ad24481412ca2bfda11a3b1659535f29df43 (diff)
Beef up the random number generator by using Joomla's new implementation.
Diffstat (limited to 'modules/gallery/helpers/random.php')
-rw-r--r--modules/gallery/helpers/random.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gallery/helpers/random.php b/modules/gallery/helpers/random.php
index 0ee83f49..ea08815a 100644
--- a/modules/gallery/helpers/random.php
+++ b/modules/gallery/helpers/random.php
@@ -17,13 +17,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
class random_Core {
/**
* Return a random 32 byte hash value.
* @param string extra entropy data
*/
- static function hash($entropy="") {
- return md5($entropy . uniqid(mt_rand(), true));
+ static function hash($length=32) {
+ require_once(MODPATH . "gallery/vendor/joomla/crypt.php");
+ return md5(JCrypt::genRandomBytes($length));
}
/**