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

Breadcrumb

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

function NoProxyPattern::ipMapTo6

Maps an IPv4 address to IPv6

Parameters

string $binary in_addr:

int $size Byte size of in_addr:

Return value

string Mapped or existing in_addr

2 calls to NoProxyPattern::ipMapTo6()
NoProxyPattern::ipGetAddr in vendor/composer/composer/src/Composer/Util/NoProxyPattern.php
Returns an array of the IP in_addr and its byte size
NoProxyPattern::ipGetMask in vendor/composer/composer/src/Composer/Util/NoProxyPattern.php
Returns the binary network mask mapped to IPv6

File

vendor/composer/composer/src/Composer/Util/NoProxyPattern.php, line 313

Class

NoProxyPattern
Tests URLs against NO_PROXY patterns

Namespace

Composer\Util

Code

private function ipMapTo6(string $binary, int $size) : string {
    if ($size === 4) {
        $prefix = str_repeat(chr(0), 10) . str_repeat(chr(255), 2);
        $binary = $prefix . $binary;
    }
    return $binary;
}

API Navigation

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