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

Breadcrumb

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

function Uuid::uuid5

Returns a version 5 (name-based) UUID based on the SHA-1 hash of a namespace ID and a name

@psalm-pure note: changing the internal factory is an edge case not covered by purity invariants, but under constant factory setups, this method operates in functionally pure manners

@psalm-suppress ImpureMethodCall we know that the factory being replaced can lead to massive havoc across all consumers: that should never happen, and is generally to be discouraged. Until the factory is kept un-replaced, this method is effectively pure.

Parameters

string|UuidInterface $ns The namespace (must be a valid UUID):

string $name The name to use for creating a UUID:

Return value

UuidInterface A UuidInterface instance that represents a version 5 UUID

File

vendor/ramsey/uuid/src/Uuid.php, line 680

Class

Uuid
Uuid provides constants and static methods for working with and generating UUIDs

Namespace

Ramsey\Uuid

Code

public static function uuid5($ns, string $name) : UuidInterface {
    return self::getFactory()->uuid5($ns, $name);
}

API Navigation

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