ALPHA 3.0.2a

This commit is contained in:
TheGamecraft
2018-09-10 08:51:18 -04:00
parent 7fe13ae0a7
commit 0e0ef86b71
1404 changed files with 10604 additions and 33714 deletions

View File

@@ -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)
{