md5()/sha1() -> hash()
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 15 Jan 2009 04:56:01 +0000 (21:56 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 15 Jan 2009 04:56:01 +0000 (21:56 -0700)
framework/Browser/lib/Horde/Browser.php
framework/Crypt/lib/Horde/Crypt/smime.php
framework/Imap_Client/lib/Horde/Imap/Client/Base.php
framework/Imap_Client/lib/Horde/Imap/Client/Cache.php
framework/Oauth/lib/Horde/Oauth/Request.php
framework/Secret/lib/Horde/Secret.php
framework/Support/lib/Horde/Support/ConsistentHash.php

index c7d15ae..b1cb7e6 100644 (file)
@@ -270,7 +270,7 @@ class Horde_Browser
     {
         static $instances = array();
 
-        $signature = md5(serialize(array($userAgent, $accept)));
+        $signature = hash('md5', serialize(array($userAgent, $accept)));
         if (empty($instances[$signature])) {
             $instances[$signature] = new Horde_Browser($userAgent, $accept);
         }
index 2dc3ea3..64528a7 100644 (file)
@@ -701,8 +701,8 @@ class Horde_Crypt_smime extends Horde_Crypt
         }
 
         $cert_details = array();
-        $cert_details['fingerprints']['md5'] = md5($raw_cert);
-        $cert_details['fingerprints']['sha1'] = sha1($raw_cert);
+        $cert_details['fingerprints']['md5'] = hash('md5', $raw_cert);
+        $cert_details['fingerprints']['sha1'] = hash('sha1', $raw_cert);
 
         $cert_details['certificate']['extensions'] = array();
         $cert_details['certificate']['version'] = $cert_data[1][0][1][0][1] + 1;
index 8bb743f..9ad0448 100644 (file)
@@ -314,7 +314,7 @@ abstract class Horde_Imap_Client_Base extends Horde_Imap_Client
     {
         $additional = array_map(array('Horde_Imap_Client_Utf7imap', 'Utf7ImapToUtf8'), $additional);
 
-        $sig = md5(serialize($additional));
+        $sig = hash('md5', serialize($additional));
 
         if (isset($this->_init['namespace'][$sig])) {
             return $this->_init['namespace'][$sig];
@@ -1843,7 +1843,7 @@ abstract class Horde_Imap_Client_Base extends Horde_Imap_Client
             }
 
             if (!empty($crit)) {
-                $sig = md5(serialize(array_values($crit)));
+                $sig = hash('md5', serialize(array_values($crit)));
                 if (isset($new_criteria[$sig])) {
                     $new_criteria[$sig]['i'][] = $id;
                 } else {
index 22ef45c..55c2f16 100644 (file)
@@ -90,7 +90,7 @@ class Horde_Imap_Client_Cache
     {
         static $instance = array();
 
-        $sig = md5(serialize($params));
+        $sig = hash('md5', serialize($params));
         if (!isset($instance[$sig])) {
             $instance[$sig] = new Horde_Imap_Client_Cache($params);
         }
index aa0a166..2676e58 100644 (file)
@@ -84,7 +84,7 @@ class Horde_Oauth_Request
         $mt = microtime();
         $rand = mt_rand();
 
-        return md5(microtime() . mt_rand());
+        return hash('md5', microtime() . mt_rand());
     }
 
     /**
index be1ef8e..1a35fcd 100644 (file)
@@ -100,7 +100,7 @@ class Horde_Secret
      */
     static protected function _getCipherOb($key)
     {
-        $idx = md5($key);
+        $idx = hash('md5', $key);
 
         if (!isset(self::$_cipherCache[$idx])) {
             self::$_cipherCache[$idx] = &Horde_Cipher::factory('blowfish');
@@ -126,7 +126,7 @@ class Horde_Secret
             if (isset($_COOKIE[$keyname . '_key'])) {
                 $key = $_COOKIE[$keyname . '_key'];
             } else {
-                $key = md5(mt_rand());
+                $key = hash('md5', mt_rand());
                 $_COOKIE[$keyname . '_key'] = $key;
                 Secret::_setCookie($keyname, $key);
             }
index e094afd..6177f93 100644 (file)
@@ -230,7 +230,7 @@ class Horde_Support_ConsistentHash
      */
     public function hash($key)
     {
-        return substr(md5($key), 0, 8);
+        return substr(hash('md5', $key), 0, 8);
     }
 
     /**