Skip to content

Commit

Permalink
Update KeyGeneratorService.php
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed Dec 15, 2023
1 parent 10c78c7 commit ea85a47
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/Services/KeyGeneratorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ public function generateSimpleString(string $value): string
* Generate a random string of specified length. The string will only contain
* characters from the specified character set.
*
* @param string $alphabet The alphabet as a sequence of unique characters.
* @param int $length The length of the string to generate.
* @return string The generated random string.
*/
public function generateRandomString(string $alphabet, int $length): string
public function generateRandomString(): string
{
do {
$urlKey = $this->getBytesFromString($alphabet, $length);
$urlKey = $this->getBytesFromString(self::ALPHABET, config('urlhub.hash_length'));
} while ($this->ensureStringCanBeUsedAsKey($urlKey) == false);

return $urlKey;
Expand Down

0 comments on commit ea85a47

Please sign in to comment.