diff --git a/Blacklight/NZBImport.php b/Blacklight/NZBImport.php index a2a6b1cfe..034752ee1 100755 --- a/Blacklight/NZBImport.php +++ b/Blacklight/NZBImport.php @@ -323,7 +323,7 @@ class NZBImport protected function insertNZB($nzbDetails): bool { // Make up a GUID for the release. - $this->relGuid = createGUID(); + $this->relGuid = Str::uuid()->toString(); // Remove part count from subject. $partLess = preg_replace('/(\(\d+\/\d+\))*$/', 'yEnc', $nzbDetails['subject']); diff --git a/Blacklight/processing/ProcessReleases.php b/Blacklight/processing/ProcessReleases.php index cff7eba1a..561caa7f3 100755 --- a/Blacklight/processing/ProcessReleases.php +++ b/Blacklight/processing/ProcessReleases.php @@ -453,7 +453,7 @@ class ProcessReleases 'searchname' => $searchName, 'totalpart' => $collection->totalfiles, 'groups_id' => $collection->groups_id, - 'guid' => createGUID(), + 'guid' => Str::uuid()->toString(), 'postdate' => $collection->date, 'fromname' => $fromName, 'size' => $collection->filesize, diff --git a/app/Extensions/helper/helpers.php b/app/Extensions/helper/helpers.php index 479d42fbd..04fbcc4ee 100644 --- a/app/Extensions/helper/helpers.php +++ b/app/Extensions/helper/helpers.php @@ -137,20 +137,6 @@ if (! function_exists('getUserBrowseOrdering')) { } } -if (! function_exists('createGUID')) { - /** - * @throws Exception - */ - function createGUID(): string - { - $data = random_bytes(16); - $data[6] = \chr(\ord($data[6]) & 0x0F | 0x40); // set version to 0100 - $data[8] = \chr(\ord($data[8]) & 0x3F | 0x80); // set bits 6-7 to 10 - - return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(sodium_bin2hex($data), 4)); - } -} - if (! function_exists('getSimilarName')) { /** * @param string $name