aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-11-09 09:10:19 +0000
committerMario <mario@mariovavti.com>2021-11-09 09:10:19 +0000
commitfe7ecede700fe04631d23f36473e697ce2b364dc (patch)
treee713fc39dba500a25cb2acf8561e286fb8b41ff0 /vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php
parent42de18d96d201d74e5df3ed1b8f6132cb00357b6 (diff)
parent089708ab9f90309a0c27ae633cf8f2604fce1170 (diff)
downloadvolse-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/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(