From e6dac085cb1d601da1fc63bfd59d811612fa6ef4 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 8 Oct 2021 12:24:19 +0000 Subject: update composer libs --- vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php') 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( -- cgit v1.2.3