Skip to content

Commit

Permalink
Revert comment change
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Jul 23, 2024
1 parent ff7c8cb commit 5e6b67b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Classes/KeyGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ public function __construct(Hashids $hashids)
}

/**
* Generate a unique and random URL key using the Hashids package.
*
* @return string
* Generate a unique and random URL key using the Hashids package. We start by
* predicting the unique ID that the ShortURL will have in the database.
* Then we can encode the ID to create a unique hash. On the very
* unlikely chance that a generated key collides with another
* key, we increment the ID and then attempt to create a new
* unique key again.
*/
public function generateRandom(): string
{
Expand Down

0 comments on commit 5e6b67b

Please sign in to comment.