diff options
author | Mario <mario@mariovavti.com> | 2021-11-09 09:10:19 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-11-09 09:10:19 +0000 |
commit | fe7ecede700fe04631d23f36473e697ce2b364dc (patch) | |
tree | e713fc39dba500a25cb2acf8561e286fb8b41ff0 /vendor/ramsey/uuid/src/Generator | |
parent | 42de18d96d201d74e5df3ed1b8f6132cb00357b6 (diff) | |
parent | 089708ab9f90309a0c27ae633cf8f2604fce1170 (diff) | |
download | volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.gz volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.bz2 volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.zip |
Merge branch '6.4RC'6.4
Diffstat (limited to 'vendor/ramsey/uuid/src/Generator')
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(), |