aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Generator/CombGenerator.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-11 18:29:06 +0000
committerMario <mario@mariovavti.com>2022-10-11 18:29:06 +0000
commitccd826f63a7a4c7e442fab8a70d9c4c84808b417 (patch)
treefbbde69114acba764cf6b735433c53e099fd19c5 /vendor/ramsey/uuid/src/Generator/CombGenerator.php
parent5e5f0aa955d86743a14531bed98501b59140ab1f (diff)
downloadvolse-hubzilla-ccd826f63a7a4c7e442fab8a70d9c4c84808b417.tar.gz
volse-hubzilla-ccd826f63a7a4c7e442fab8a70d9c4c84808b417.tar.bz2
volse-hubzilla-ccd826f63a7a4c7e442fab8a70d9c4c84808b417.zip
Revert "update composer libs"
This reverts commit 5e5f0aa955d86743a14531bed98501b59140ab1f.
Diffstat (limited to 'vendor/ramsey/uuid/src/Generator/CombGenerator.php')
-rw-r--r--vendor/ramsey/uuid/src/Generator/CombGenerator.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/vendor/ramsey/uuid/src/Generator/CombGenerator.php b/vendor/ramsey/uuid/src/Generator/CombGenerator.php
index 0e8870608..25b7988ec 100644
--- a/vendor/ramsey/uuid/src/Generator/CombGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/CombGenerator.php
@@ -61,10 +61,22 @@ class CombGenerator implements RandomGeneratorInterface
{
public const TIMESTAMP_BYTES = 6;
+ /**
+ * @var RandomGeneratorInterface
+ */
+ private $randomGenerator;
+
+ /**
+ * @var NumberConverterInterface
+ */
+ private $converter;
+
public function __construct(
- private RandomGeneratorInterface $generator,
- private NumberConverterInterface $numberConverter
+ RandomGeneratorInterface $generator,
+ NumberConverterInterface $numberConverter
) {
+ $this->converter = $numberConverter;
+ $this->randomGenerator = $generator;
}
/**
@@ -83,11 +95,11 @@ class CombGenerator implements RandomGeneratorInterface
$hash = '';
if (self::TIMESTAMP_BYTES > 0 && $length > self::TIMESTAMP_BYTES) {
- $hash = $this->generator->generate($length - self::TIMESTAMP_BYTES);
+ $hash = $this->randomGenerator->generate($length - self::TIMESTAMP_BYTES);
}
$lsbTime = str_pad(
- $this->numberConverter->toHex($this->timestamp()),
+ $this->converter->toHex($this->timestamp()),
self::TIMESTAMP_BYTES * 2,
'0',
STR_PAD_LEFT