php-uuid
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
hellsh\UUID Class Reference

Public Member Functions

 __construct (string $uuid)
 
 toString (bool $with_dashes=false)
 
 __toString ()
 
 hashCode ()
 

Static Public Member Functions

static getNullUuid ()
 
static getDnsNamespace ()
 
static getUrlNamespace ()
 
static v3 (string $str, ?UUID $namespace=null)
 
static v4 ()
 
static v5 (string $str, ?UUID $namespace=null)
 

Public Attributes

 $binary
 

Constructor & Destructor Documentation

◆ __construct()

hellsh\UUID::__construct ( string  $uuid)
Parameters
string$uuidA UUID string or 16-byte binary string.
Exceptions
InvalidArgumentExceptionWhen the given string is not a valid UUID.

Member Function Documentation

◆ __toString()

hellsh\UUID::__toString ( )

◆ getDnsNamespace()

static hellsh\UUID::getDnsNamespace ( )
static

Returns the namespace intended for fully-qualified domain names.

Returns
UUID
Since
1.2

◆ getNullUuid()

static hellsh\UUID::getNullUuid ( )
static

Returns the NULL UUID, which has all 128 bits set to zero.

Returns
UUID
Since
1.2

◆ getUrlNamespace()

static hellsh\UUID::getUrlNamespace ( )
static

Returns the namespace intended for URLs.

Returns
UUID
Since
1.2

◆ hashCode()

hellsh\UUID::hashCode ( )

Returns a hash code for this UUID.

Since
1.1
Returns
int

◆ toString()

hellsh\UUID::toString ( bool  $with_dashes = false)

Returns the string representation of the UUID.

Parameters
boolean$with_dashes
Returns
string

◆ v3()

static hellsh\UUID::v3 ( string  $str,
?UUID  $namespace = null 
)
static

Generates a UUIDv3.

Since
1.2
Parameters
string$str
UUID | null$namespaceDefaults to NULL UUID.
Returns
UUID

◆ v4()

static hellsh\UUID::v4 ( )
static

Generates a UUIDv4.

Returns
UUID

◆ v5()

static hellsh\UUID::v5 ( string  $str,
?UUID  $namespace = null 
)
static

Generates a UUIDv5.

Parameters
string$str
UUID | null$namespaceDefaults to NULL UUID.
Returns
UUID

Member Data Documentation

◆ $binary

string hellsh\UUID::$binary

The 16-byte binary string containing the UUID.


The documentation for this class was generated from the following file: