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

Breadcrumb

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

function StaticNodeProvider::setMulticastBit

Set the multicast bit for the static node value

1 call to StaticNodeProvider::setMulticastBit()
StaticNodeProvider::__construct in vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php

File

vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php, line 59

Class

StaticNodeProvider
StaticNodeProvider provides a static node value with the multicast bit set

Namespace

Ramsey\Uuid\Provider\Node

Code

private function setMulticastBit(Hexadecimal $node) : Hexadecimal {
    $nodeHex = str_pad($node->toString(), 12, '0', STR_PAD_LEFT);
    $firstOctet = substr($nodeHex, 0, 2);
    $firstOctet = str_pad(dechex(hexdec($firstOctet) | 0x1), 2, '0', STR_PAD_LEFT);
    return new Hexadecimal($firstOctet . substr($nodeHex, 2));
}

API Navigation

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