()
| 10 | }; |
| 11 | |
| 12 | function legacyCreateRandomString() { |
| 13 | const USE_HEX = 36; |
| 14 | const SKIP_LEADING_ZERODOT = 2; |
| 15 | const ASCII_A = 97; |
| 16 | const NUMBER_OF_LETTERS = 26; |
| 17 | |
| 18 | /* eslint-disable sonarjs/pseudo-random */ |
| 19 | return ( |
| 20 | // eslint-disable-next-line unicorn/prefer-code-point |
| 21 | String.fromCharCode( |
| 22 | ASCII_A + Math.floor(Math.random() * NUMBER_OF_LETTERS) |
| 23 | ) + |
| 24 | Math.random() |
| 25 | .toString(USE_HEX) |
| 26 | .slice(Math.max(0, SKIP_LEADING_ZERODOT)) + |
| 27 | Math.random().toString(USE_HEX).slice(Math.max(0, SKIP_LEADING_ZERODOT)) |
| 28 | ); |
| 29 | /* eslint-enable sonarjs/pseudo-random */ |
| 30 | } |
no outgoing calls
no test coverage detected