[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/ramsey/uuid/src/ -> Uuid.php (summary)

This file is part of the ramsey/uuid library For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

Copyright: Copyright (c) Ben Ramsey <[email protected]>
License: http://opensource.org/licenses/MIT MIT
File Size: 780 lines (23 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Uuid:: (50 methods):
  __construct()
  __toString()
  jsonSerialize()
  serialize()
  __serialize()
  unserialize()
  __unserialize()
  compareTo()
  equals()
  getBytes()
  getClockSeqHiAndReserved()
  getClockSeqHiAndReservedHex()
  getClockSeqLow()
  getClockSeqLowHex()
  getClockSequence()
  getClockSequenceHex()
  getNumberConverter()
  getDateTime()
  getFields()
  getFieldsHex()
  getHex()
  getInteger()
  getLeastSignificantBits()
  getLeastSignificantBitsHex()
  getMostSignificantBits()
  getMostSignificantBitsHex()
  getNode()
  getNodeHex()
  getTimeHiAndVersion()
  getTimeHiAndVersionHex()
  getTimeLow()
  getTimeLowHex()
  getTimeMid()
  getTimeMidHex()
  getTimestamp()
  getTimestampHex()
  getUrn()
  getVariant()
  getVersion()
  toString()
  getFactory()
  setFactory()
  fromBytes()
  fromString()
  fromInteger()
  isValid()
  uuid1()
  uuid3()
  uuid4()
  uuid5()


Class: Uuid  - X-Ref

Represents a universally unique identifier (UUID), according to RFC 4122.

This class provides immutable UUID objects (the Uuid class) and the static
methods `uuid1()`, `uuid3()`, `uuid4()`, and `uuid5()` for generating version
1, 3, 4, and 5 UUIDs as specified in RFC 4122.

If all you want is a unique ID, you should probably call `uuid1()` or `uuid4()`.
Note that `uuid1()` may compromise privacy since it creates a UUID containing
the computer’s network address. `uuid4()` creates a random UUID.

__construct(array $fields,NumberConverterInterface $converter,CodecInterface $codec)   X-Ref
Creates a universally unique identifier (UUID) from an array of fields.

Unless you're making advanced use of this library to generate identifiers
that deviate from RFC 4122, you probably do not want to instantiate a
UUID directly. Use the static methods, instead:

```
use Ramsey\Uuid\Uuid;

$timeBasedUuid     = Uuid::uuid1();
$namespaceMd5Uuid  = Uuid::uuid3(Uuid::NAMESPACE_URL, 'http://php.net/');
$randomUuid        = Uuid::uuid4();
$namespaceSha1Uuid = Uuid::uuid5(Uuid::NAMESPACE_URL, 'http://php.net/');
```

param: array $fields An array of fields from which to construct a UUID;
param: NumberConverterInterface $converter The number converter to use
param: CodecInterface $codec The codec to use when encoding or decoding

__toString()   X-Ref
Converts this UUID object to a string when the object is used in any
string context.

return: string

jsonSerialize()   X-Ref
Converts this UUID object to a string when the object is serialized
with `json_encode()`

return: string

serialize()   X-Ref
Converts this UUID object to a string when the object is serialized
with `serialize()`

return: string

__serialize()   X-Ref

return: array{string: string}

unserialize($serialized)   X-Ref
Re-constructs the object from its serialized form.

param: string $serialized

__unserialize(array $serialized)   X-Ref

param: array{string: string} $serialized
return: void

compareTo(UuidInterface $other)   X-Ref
No description

equals($other)   X-Ref
No description

getBytes()   X-Ref
No description

getClockSeqHiAndReserved()   X-Ref
Returns the high field of the clock sequence multiplexed with the variant
(bits 65-72 of the UUID).

return: int Unsigned 8-bit integer value of clock_seq_hi_and_reserved

getClockSeqHiAndReservedHex()   X-Ref
No description

getClockSeqLow()   X-Ref
Returns the low field of the clock sequence (bits 73-80 of the UUID).

return: int Unsigned 8-bit integer value of clock_seq_low

getClockSeqLowHex()   X-Ref
No description

getClockSequence()   X-Ref
Returns the clock sequence value associated with this UUID.

For UUID version 1, the clock sequence is used to help avoid
duplicates that could arise when the clock is set backwards in time
or if the node ID changes.

For UUID version 3 or 5, the clock sequence is a 14-bit value
constructed from a name as described in RFC 4122, Section 4.3.

For UUID version 4, clock sequence is a randomly or pseudo-randomly
generated 14-bit value as described in RFC 4122, Section 4.4.

return: int Unsigned 14-bit integer value of clock sequence

getClockSequenceHex()   X-Ref
No description

getNumberConverter()   X-Ref
No description

getDateTime()   X-Ref


getFields()   X-Ref
Returns an array of the fields of this UUID, with keys named according
to the RFC 4122 names for the fields.

* **time_low**: The low field of the timestamp, an unsigned 32-bit integer
* **time_mid**: The middle field of the timestamp, an unsigned 16-bit integer
* **time_hi_and_version**: The high field of the timestamp multiplexed with
the version number, an unsigned 16-bit integer
* **clock_seq_hi_and_reserved**: The high field of the clock sequence
multiplexed with the variant, an unsigned 8-bit integer
* **clock_seq_low**: The low field of the clock sequence, an unsigned
8-bit integer
* **node**: The spatially unique node identifier, an unsigned 48-bit
integer

return: array The UUID fields represented as integer values

getFieldsHex()   X-Ref
No description

getHex()   X-Ref
No description

getInteger()   X-Ref


getLeastSignificantBits()   X-Ref
Returns the least significant 64 bits of this UUID's 128 bit value.

return: mixed Converted representation of the unsigned 64-bit integer value

getLeastSignificantBitsHex()   X-Ref
No description

getMostSignificantBits()   X-Ref
Returns the most significant 64 bits of this UUID's 128 bit value.

return: mixed Converted representation of the unsigned 64-bit integer value

getMostSignificantBitsHex()   X-Ref
No description

getNode()   X-Ref
Returns the node value associated with this UUID

For UUID version 1, the node field consists of an IEEE 802 MAC
address, usually the host address. For systems with multiple IEEE
802 addresses, any available one can be used. The lowest addressed
octet (octet number 10) contains the global/local bit and the
unicast/multicast bit, and is the first octet of the address
transmitted on an 802.3 LAN.

For systems with no IEEE address, a randomly or pseudo-randomly
generated value may be used; see RFC 4122, Section 4.5. The
multicast bit must be set in such addresses, in order that they
will never conflict with addresses obtained from network cards.

For UUID version 3 or 5, the node field is a 48-bit value constructed
from a name as described in RFC 4122, Section 4.3.

For UUID version 4, the node field is a randomly or pseudo-randomly
generated 48-bit value as described in RFC 4122, Section 4.4.

return: int Unsigned 48-bit integer value of node

getNodeHex()   X-Ref
No description

getTimeHiAndVersion()   X-Ref
Returns the high field of the timestamp multiplexed with the version
number (bits 49-64 of the UUID).

return: int Unsigned 16-bit integer value of time_hi_and_version

getTimeHiAndVersionHex()   X-Ref
No description

getTimeLow()   X-Ref
Returns the low field of the timestamp (the first 32 bits of the UUID).

return: int Unsigned 32-bit integer value of time_low

getTimeLowHex()   X-Ref
No description

getTimeMid()   X-Ref
Returns the middle field of the timestamp (bits 33-48 of the UUID).

return: int Unsigned 16-bit integer value of time_mid

getTimeMidHex()   X-Ref
No description

getTimestamp()   X-Ref
Returns the timestamp value associated with this UUID.

The 60 bit timestamp value is constructed from the time_low,
time_mid, and time_hi fields of this UUID. The resulting
timestamp is measured in 100-nanosecond units since midnight,
October 15, 1582 UTC.

The timestamp value is only meaningful in a time-based UUID, which
has version type 1. If this UUID is not a time-based UUID then
this method throws UnsupportedOperationException.

return: int Unsigned 60-bit integer value of the timestamp

getTimestampHex()   X-Ref


getUrn()   X-Ref
No description

getVariant()   X-Ref
No description

getVersion()   X-Ref
No description

toString()   X-Ref
No description

getFactory()   X-Ref
Returns the currently set factory used to create UUIDs.

return: UuidFactoryInterface

setFactory(UuidFactoryInterface $factory)   X-Ref
Sets the factory used to create UUIDs.

param: UuidFactoryInterface $factory

fromBytes($bytes)   X-Ref
Creates a UUID from a byte string.

param: string $bytes
return: UuidInterface

fromString($name)   X-Ref
Creates a UUID from the string standard representation.

param: string $name A string that specifies a UUID
return: UuidInterface

fromInteger($integer)   X-Ref
Creates a UUID from a 128-bit integer string.

param: string $integer String representation of 128-bit integer
return: UuidInterface

isValid($uuid)   X-Ref
Check if a string is a valid UUID.

param: string $uuid The string UUID to test
return: boolean

uuid1($node = null, $clockSeq = null)   X-Ref
Generate a version 1 UUID from a host ID, sequence number, and the current time.

param: int|string $node A 48-bit number representing the hardware address
param: int $clockSeq A 14-bit number used to help avoid duplicates that
return: UuidInterface

uuid3($ns, $name)   X-Ref
Generate a version 3 UUID based on the MD5 hash of a namespace identifier
(which is a UUID) and a name (which is a string).

param: string|UuidInterface $ns The UUID namespace in which to create the named UUID
param: string $name The name to create a UUID for
return: UuidInterface

uuid4()   X-Ref
Generate a version 4 (random) UUID.

return: UuidInterface

uuid5($ns, $name)   X-Ref
Generate a version 5 UUID based on the SHA-1 hash of a namespace
identifier (which is a UUID) and a name (which is a string).

param: string|UuidInterface $ns The UUID namespace in which to create the named UUID
param: string $name The name to create a UUID for
return: UuidInterface



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer