aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php
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/DefaultNameGenerator.php
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/DefaultNameGenerator.php')
-rw-r--r--vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php9
1 files changed, 7 insertions, 2 deletions
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(