function Idn::adaptBias
Parameters
int $delta:
int $numPoints:
bool $firstTime:
Return value
int
See also
https://tools.ietf.org/html/rfc3492#section-6.1
2 calls to Idn::adaptBias()
- Idn::punycodeDecode in vendor/
symfony/ polyfill-intl-idn/ Idn.php - Idn::punycodeEncode in vendor/
symfony/ polyfill-intl-idn/ Idn.php
File
-
vendor/
symfony/ polyfill-intl-idn/ Idn.php, line 763
Class
- Idn
- @internal
Namespace
Symfony\Polyfill\Intl\IdnCode
private static function adaptBias($delta, $numPoints, $firstTime) {
// xxx >> 1 is a faster way of doing intdiv(xxx, 2)
$delta = $firstTime ? intdiv($delta, self::DAMP) : $delta >> 1;
$delta += intdiv($delta, $numPoints);
$k = 0;
while ($delta > (self::BASE - self::TMIN) * self::TMAX >> 1) {
$delta = intdiv($delta, self::BASE - self::TMIN);
$k += self::BASE;
}
return $k + intdiv((self::BASE - self::TMIN + 1) * $delta, $delta + self::SKEW);
}