diff --git a/src/Builder/Pdf/AbstractPdfBuilder.php b/src/Builder/Pdf/AbstractPdfBuilder.php index b72e8b00..5796c2ae 100644 --- a/src/Builder/Pdf/AbstractPdfBuilder.php +++ b/src/Builder/Pdf/AbstractPdfBuilder.php @@ -72,7 +72,7 @@ public function __construct( }, ]; - $this->operationIdGenerator = static fn (): string => uniqid('gotenberg_', true); + $this->operationIdGenerator = static fn (): string => 'gotenberg_'.bin2hex(random_bytes(16)).microtime(true); } public function setLogger(LoggerInterface|null $logger): void diff --git a/src/Builder/Screenshot/AbstractScreenshotBuilder.php b/src/Builder/Screenshot/AbstractScreenshotBuilder.php index 7625a625..a70f5121 100644 --- a/src/Builder/Screenshot/AbstractScreenshotBuilder.php +++ b/src/Builder/Screenshot/AbstractScreenshotBuilder.php @@ -63,7 +63,7 @@ public function __construct( }, ]; - $this->operationIdGenerator = fn () => uniqid('gotenberg_', true); + $this->operationIdGenerator = static fn (): string => 'gotenberg_'.bin2hex(random_bytes(16)).microtime(true); } public function setLogger(LoggerInterface|null $logger): void