Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Idn.php

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\Idn

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal