cvs: php4 /pear/Crypt HCEMD5.php
| From: | Chuck Hagenbuch | Date: | Thu, 09 Nov 2000 04:05:41 +0000 |
| Subject: | cvs: php4 /pear/Crypt HCEMD5.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2537@lists.php.net to get a copy of this message | ||
chagenbu Wed Nov 8 20:05:41 2000 EDT
Modified files:
/php4/pear/Crypt HCEMD5.php
Log:
beware maxint on 32-bit platforms
Index: php4/pear/Crypt/HCEMD5.php
diff -u php4/pear/Crypt/HCEMD5.php:1.1 php4/pear/Crypt/HCEMD5.php:1.2
--- php4/pear/Crypt/HCEMD5.php:1.1 Mon Nov 6 14:33:09 2000
+++ php4/pear/Crypt/HCEMD5.php Wed Nov 8 20:05:41 2000
@@ -43,9 +43,9 @@
Usage:
require_once 'Crypt/HCEMD5.php';
$key = 'my secret key';
- srand((double)microtime()*1000000);
- $rand = rand(1, 1000000);
- $rand = pack ('i*', $rand);
+ srand((double)microtime()*32767);
+ $rand = rand(1, 32767);
+ $rand = pack('i*', $rand);
$message = 'text to encrypt';
$hcemd5 = new Crypt_HCEMD5($key, $rand);
@@ -92,9 +92,9 @@
$this->key = $key;
if (!isset($rand)) {
- srand((double)microtime() * 1000000);
- $rand = rand(1, 1000000);
- $rand = pack ("i*", $rand);
+ srand((double)microtime() * 32767);
+ $rand = rand(1, 32767);
+ $rand = pack('i*', $rand);
}
$this->rand = $rand;
}