mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 06:13:45 +02:00
Update random ID method to use str_random and not random_bytes
The use of random_bytes in combination with bin2hex was producing a lot of duplicate keys when tested in batches of 10k (anywhere from 2 to 6). The use of str_random yielded no duplicates even at scales of 100k keys that were 8 characters.
This commit is contained in:
@@ -83,7 +83,7 @@ class NodeUpdateService
|
||||
}
|
||||
|
||||
if (! is_null(array_get($data, 'reset_secret'))) {
|
||||
$data['daemonSecret'] = bin2hex(random_bytes(NodeCreationService::DAEMON_SECRET_LENGTH));
|
||||
$data['daemonSecret'] = str_random(NodeCreationService::DAEMON_SECRET_LENGTH);
|
||||
unset($data['reset_secret']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user