webCOMAND

uuid::v5()

Generate and return a Version 5 UUID, which is name based.  They require a namespace (another valid UUID) and a value (the name).  Given the same namespace and name, the output is always the same.  Version 5 UUIDs use a SHA1 hashing algorithm internally.

Prototype

string v5(string $namespace, string $name)

Parameters

  • namespace - A valid UUID to use as the namespace.
  • name - Name as a string of text that can be any length.

Example

$repo = \comand::repo();
$root = $repo->get_root();
$namespace = $root->UUID;
$name = 'Unique name';
$new_uuid = \io_comand_util\uuid::v5($namespace, $name);