Reverting change to Security::cipher(); in [7322]. Newer versions of PHP 5.2.1 and above no longer produce same identical seeds

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7324 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2008-07-05 15:03:46 +00:00
parent ed0a031ec4
commit 3713fe25ae

View file

@ -183,14 +183,14 @@ class Security extends Object {
//This is temporary will change later
define('CIPHER_SEED', '76859309657453542496749683645');
}
mt_srand(CIPHER_SEED);
srand(CIPHER_SEED);
$out = '';
for ($i = 0; $i < strlen($text); $i++) {
for ($j = 0; $j < ord(substr($key, $i % strlen($key), 1)); $j++) {
$toss = mt_rand(0, 255);
$toss = rand(0, 255);
}
$mask = mt_rand(0, 255);
$mask = rand(0, 255);
$out .= chr(ord(substr($text, $i, 1)) ^ $mask);
}
return $out;