helper.rst 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. .. _reference.helper:
  2. ================
  3. Helper Functions
  4. ================
  5. ramsey/uuid additionally provides the following helper functions, which return
  6. only the string standard representation of a UUID.
  7. .. php:function:: Ramsey\\Uuid\\v1([$node[, $clockSeq]])
  8. Generates a string standard representation of a version 1, Gregorian time UUID.
  9. :param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
  10. :param int|null $clockSeq: An optional clock sequence to use
  11. :returns: A string standard representation of a version 1 UUID
  12. :returntype: string
  13. .. php:function:: Ramsey\\Uuid\\v2($localDomain[, $localIdentifier[, $node[, $clockSeq]]])
  14. Generates a string standard representation of a version 2, DCE Security UUID.
  15. :param int $localDomain: The local domain to use (one of ``Uuid::DCE_DOMAIN_PERSON``, ``Uuid::DCE_DOMAIN_GROUP``, or ``Uuid::DCE_DOMAIN_ORG``)
  16. :param Ramsey\\Uuid\\Type\\Integer|null $localIdentifier: A local identifier for the domain (defaults to system UID or GID for *person* or *group*)
  17. :param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
  18. :param int|null $clockSeq: An optional clock sequence to use
  19. :returns: A string standard representation of a version 2 UUID
  20. :returntype: string
  21. .. php:function:: Ramsey\\Uuid\\v3($ns, $name)
  22. Generates a string standard representation of a version 3, name-based (MD5) UUID.
  23. :param Ramsey\\Uuid\\UuidInterface|string $ns: The namespace for this identifier
  24. :param string $name: The name from which to generate an identifier
  25. :returns: A string standard representation of a version 3 UUID
  26. :returntype: string
  27. .. php:function:: Ramsey\\Uuid\\v4()
  28. Generates a string standard representation of a version 4, random UUID.
  29. :returns: A string standard representation of a version 4 UUID
  30. :returntype: string
  31. .. php:function:: Ramsey\\Uuid\\v5($ns, $name)
  32. Generates a string standard representation of a version 5, name-based (SHA-1) UUID.
  33. :param Ramsey\\Uuid\\UuidInterface|string $ns: The namespace for this identifier
  34. :param string $name: The name from which to generate an identifier
  35. :returns: A string standard representation of a version 5 UUID
  36. :returntype: string
  37. .. php:function:: Ramsey\\Uuid\\v6([$node[, $clockSeq]])
  38. Generates a string standard representation of a version 6, reordered time UUID.
  39. :param Ramsey\\Uuid\\Type\\Hexadecimal|null $node: An optional hexadecimal node to use
  40. :param int|null $clockSeq: An optional clock sequence to use
  41. :returns: A string standard representation of a version 6 UUID
  42. :returntype: string