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