diff options
| author | Yunheng Liu <121078488+Kookiejarz@users.noreply.github.com> | 2026-04-01 14:59:48 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-01 14:59:48 +0300 |
| commit | 169b216d7eba1641f46dd8ab4b64dfb8f0a5cc2f (patch) | |
| tree | 6c9a7558c2fb24453d1d5eadec2f3a6c1b96dffa /x-ui.sh | |
| parent | 7e6d80efa5de0990fc701d75230a9505289f9de0 (diff) | |
perf: replace /dev/urandom | tr with openssl rand to fix CPU spike (#3887)
Diffstat (limited to 'x-ui.sh')
| -rw-r--r-- | x-ui.sh | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -243,8 +243,9 @@ reset_user() { gen_random_string() { local length="$1" - local random_string=$(LC_ALL=C tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w "$length" | head -n 1) - echo "$random_string" + openssl rand -base64 $(( length * 2 )) \ + | tr -dc 'a-zA-Z0-9' \ + | head -c "$length" } reset_webbasepath() { |
