aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Generator
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-10-08 12:24:19 +0000
committerMario <mario@mariovavti.com>2021-10-08 12:24:19 +0000
commite6dac085cb1d601da1fc63bfd59d811612fa6ef4 (patch)
treef5b704b613c9c8d347857b4e7f8dd0b19cdd7df3 /vendor/ramsey/uuid/src/Generator
parentf5f357060bf0ebcb0b8352519375953d993437e7 (diff)
downloadvolse-hubzilla-e6dac085cb1d601da1fc63bfd59d811612fa6ef4.tar.gz
volse-hubzilla-e6dac085cb1d601da1fc63bfd59d811612fa6ef4.tar.bz2
volse-hubzilla-e6dac085cb1d601da1fc63bfd59d811612fa6ef4.zip
update composer libs
Diffstat (limited to 'vendor/ramsey/uuid/src/Generator')
-rw-r--r--vendor/ramsey/uuid/src/Generator/CombGenerator.php2
-rw-r--r--vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php3
-rw-r--r--vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php9
-rw-r--r--vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php6
-rw-r--r--vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php3
-rw-r--r--vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php3
-rw-r--r--vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php3
7 files changed, 20 insertions, 9 deletions
diff --git a/vendor/ramsey/uuid/src/Generator/CombGenerator.php b/vendor/ramsey/uuid/src/Generator/CombGenerator.php
index 88ae6ea23..49b09381d 100644
--- a/vendor/ramsey/uuid/src/Generator/CombGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/CombGenerator.php
@@ -107,7 +107,7 @@ class CombGenerator implements RandomGeneratorInterface
return (string) hex2bin(
str_pad(
- bin2hex((string) $hash),
+ bin2hex($hash),
$length - self::TIMESTAMP_BYTES,
'0'
)
diff --git a/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php b/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php
index a3f07f2ff..aca8c5db7 100644
--- a/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php
@@ -138,7 +138,7 @@ class DceSecurityGenerator implements DceSecurityGeneratorInterface
}
$domainByte = pack('n', $localDomain)[1];
- $identifierBytes = hex2bin(str_pad($identifierHex, 8, '0', STR_PAD_LEFT));
+ $identifierBytes = (string) hex2bin(str_pad($identifierHex, 8, '0', STR_PAD_LEFT));
if ($node instanceof Hexadecimal) {
$node = $node->toString();
@@ -149,7 +149,6 @@ class DceSecurityGenerator implements DceSecurityGeneratorInterface
$clockSeq = $clockSeq << 8;
}
- /** @var string $bytes */
$bytes = $this->timeGenerator->generate($node, $clockSeq);
// Replace bytes in the time-based UUID with DCE Security values.
diff --git a/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php b/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php
index 270e8fbe1..7303e9fa2 100644
--- a/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php
@@ -16,6 +16,7 @@ namespace Ramsey\Uuid\Generator;
use Ramsey\Uuid\Exception\NameException;
use Ramsey\Uuid\UuidInterface;
+use ValueError;
use function hash;
@@ -28,8 +29,12 @@ class DefaultNameGenerator implements NameGeneratorInterface
/** @psalm-pure */
public function generate(UuidInterface $ns, string $name, string $hashAlgorithm): string
{
- /** @var string|bool $bytes */
- $bytes = @hash($hashAlgorithm, $ns->getBytes() . $name, true);
+ try {
+ /** @var string|bool $bytes */
+ $bytes = @hash($hashAlgorithm, $ns->getBytes() . $name, true);
+ } catch (ValueError $e) {
+ $bytes = false; // keep same behavior than PHP 7
+ }
if ($bytes === false) {
throw new NameException(sprintf(
diff --git a/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php b/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php
index 93b786878..3780c5c60 100644
--- a/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php
@@ -35,11 +35,11 @@ class PeclUuidNameGenerator implements NameGeneratorInterface
{
switch ($hashAlgorithm) {
case 'md5':
- $uuid = (string) uuid_generate_md5($ns->toString(), $name);
+ $uuid = uuid_generate_md5($ns->toString(), $name);
break;
case 'sha1':
- $uuid = (string) uuid_generate_sha1($ns->toString(), $name);
+ $uuid = uuid_generate_sha1($ns->toString(), $name);
break;
default:
@@ -49,6 +49,6 @@ class PeclUuidNameGenerator implements NameGeneratorInterface
));
}
- return (string) uuid_parse($uuid);
+ return uuid_parse($uuid);
}
}
diff --git a/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php b/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php
index df750f6a5..07c47d265 100644
--- a/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php
@@ -14,6 +14,9 @@ declare(strict_types=1);
namespace Ramsey\Uuid\Generator;
+use function uuid_create;
+use function uuid_parse;
+
use const UUID_TYPE_RANDOM;
/**
diff --git a/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php b/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php
index 903798dd3..e01f44e52 100644
--- a/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php
@@ -14,6 +14,9 @@ declare(strict_types=1);
namespace Ramsey\Uuid\Generator;
+use function uuid_create;
+use function uuid_parse;
+
use const UUID_TYPE_TIME;
/**
diff --git a/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php b/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php
index e6e9a199b..12edb96ae 100644
--- a/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php
@@ -15,6 +15,7 @@ declare(strict_types=1);
namespace Ramsey\Uuid\Generator;
use Ramsey\Uuid\Exception\RandomSourceException;
+use Throwable;
/**
* RandomBytesGenerator generates strings of random binary data using the
@@ -33,7 +34,7 @@ class RandomBytesGenerator implements RandomGeneratorInterface
{
try {
return random_bytes($length);
- } catch (\Throwable $exception) {
+ } catch (Throwable $exception) {
throw new RandomSourceException(
$exception->getMessage(),
(int) $exception->getCode(),