mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-24 03:49:10 -04:00
ALPHA 3.0.2a
This commit is contained in:
22
vendor/ramsey/uuid/src/UuidFactory.php
vendored
22
vendor/ramsey/uuid/src/UuidFactory.php
vendored
@@ -180,17 +180,26 @@ class UuidFactory implements UuidFactoryInterface
|
||||
$this->uuidBuilder = $builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function fromBytes($bytes)
|
||||
{
|
||||
return $this->codec->decodeBytes($bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function fromString($uuid)
|
||||
{
|
||||
$uuid = strtolower($uuid);
|
||||
return $this->codec->decode($uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function fromInteger($integer)
|
||||
{
|
||||
$hex = $this->numberConverter->toHex($integer);
|
||||
@@ -199,6 +208,9 @@ class UuidFactory implements UuidFactoryInterface
|
||||
return $this->fromString($hex);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function uuid1($node = null, $clockSeq = null)
|
||||
{
|
||||
$bytes = $this->timeGenerator->generate($node, $clockSeq);
|
||||
@@ -207,11 +219,17 @@ class UuidFactory implements UuidFactoryInterface
|
||||
return $this->uuidFromHashedName($hex, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function uuid3($ns, $name)
|
||||
{
|
||||
return $this->uuidFromNsAndName($ns, $name, 3, 'md5');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function uuid4()
|
||||
{
|
||||
$bytes = $this->randomGenerator->generate(16);
|
||||
@@ -224,6 +242,9 @@ class UuidFactory implements UuidFactoryInterface
|
||||
return $this->uuidFromHashedName($hex, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function uuid5($ns, $name)
|
||||
{
|
||||
return $this->uuidFromNsAndName($ns, $name, 5, 'sha1');
|
||||
@@ -253,6 +274,7 @@ class UuidFactory implements UuidFactoryInterface
|
||||
* @param string $hashFunction The hash function to use when hashing together
|
||||
* the namespace and name
|
||||
* @return UuidInterface
|
||||
* @throws \Ramsey\Uuid\Exception\InvalidUuidStringException
|
||||
*/
|
||||
protected function uuidFromNsAndName($ns, $name, $version, $hashFunction)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user