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

Breadcrumb

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

trait MaxTrait

Provides common functionality for max UUIDs

The max UUID is special form of UUID that is specified to have all 128 bits set to one. It is the inverse of the nil UUID.

@link https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis-00#… Max UUID

@psalm-immutable

Hierarchy

  • trait \Ramsey\Uuid\Rfc4122\MaxTrait
1 file declares its use of MaxTrait
Fields.php in vendor/ramsey/uuid/src/Guid/Fields.php

File

vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php, line 27

Namespace

Ramsey\Uuid\Rfc4122
View source
trait MaxTrait {
    
    /**
     * Returns the bytes that comprise the fields
     */
    public abstract function getBytes() : string;
    
    /**
     * Returns true if the byte string represents a max UUID
     */
    public function isMax() : bool {
        return $this->getBytes() === "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff";
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
MaxTrait::getBytes abstract public function Returns the bytes that comprise the fields 2
MaxTrait::isMax public function Returns true if the byte string represents a max UUID

API Navigation

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