1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-15 05:24:04 +00:00

[4.x] Improve id generators (#1300)

* add RandomIntGenerator

* remove string assertions

* make int ranges configurable

* update test to use min & max
This commit is contained in:
Samuel Štancl 2025-01-21 17:06:15 +01:00 committed by GitHub
parent 7ce7629864
commit 25360f6b6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 43 additions and 4 deletions

View file

@ -18,7 +18,7 @@ class RandomHexGenerator implements UniqueIdentifierGenerator
{
public static int $bytes = 6;
public static function generate(Model $model): string
public static function generate(Model $model): string|int
{
return bin2hex(random_bytes(static::$bytes));
}