1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-18 23:14:41 +01:00

- ord() always returns a unsigned integer, no need to force it positive

git-svn-id: file:///svn/phpbb/trunk@5618 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2006-03-10 05:35:23 +00:00
parent 678ea04497
commit 2fb1507670

View File

@ -216,15 +216,12 @@ class ucp_confirm
// We can defer the modulo operation:
// s1 maximally grows from 65521 to 65521 + 255 * 3800
// s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31
$n = 3800;
if ($n > $temp_len)
{
$n = $temp_len;
}
$n = ($temp_len < 3800) ? $temp_len : 3800;
$temp_len -= $n;
while (--$n >= 0)
{
$s1 += (ord($raw_image[$i++]) & 255);
$s1 += ord($raw_image[$i++]);
$s2 += $s1;
}
$s1 %= 65521;