mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00: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:
parent
678ea04497
commit
2fb1507670
1 changed files with 3 additions and 6 deletions
|
@ -216,15 +216,12 @@ class ucp_confirm
|
||||||
// We can defer the modulo operation:
|
// We can defer the modulo operation:
|
||||||
// s1 maximally grows from 65521 to 65521 + 255 * 3800
|
// s1 maximally grows from 65521 to 65521 + 255 * 3800
|
||||||
// s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31
|
// s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31
|
||||||
$n = 3800;
|
$n = ($temp_len < 3800) ? $temp_len : 3800;
|
||||||
if ($n > $temp_len)
|
|
||||||
{
|
|
||||||
$n = $temp_len;
|
|
||||||
}
|
|
||||||
$temp_len -= $n;
|
$temp_len -= $n;
|
||||||
while (--$n >= 0)
|
while (--$n >= 0)
|
||||||
{
|
{
|
||||||
$s1 += (ord($raw_image[$i++]) & 255);
|
$s1 += ord($raw_image[$i++]);
|
||||||
$s2 += $s1;
|
$s2 += $s1;
|
||||||
}
|
}
|
||||||
$s1 %= 65521;
|
$s1 %= 65521;
|
||||||
|
|
Loading…
Add table
Reference in a new issue