mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 13:16:39 +02:00
Make use of random_bytes for better uniqueness
This commit is contained in:
@@ -26,7 +26,7 @@ class UidProcessor
|
|||||||
throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32');
|
throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->uid = substr(hash('md5', uniqid('', true)), 0, $length);
|
$this->uid = substr(bin2hex(random_bytes((int) ceil($length / 2))), 0, $length);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __invoke(array $record): array
|
public function __invoke(array $record): array
|
||||||
|
Reference in New Issue
Block a user