2

In my JavaScript I'm using var num = Math.round(Math.random() * 10);. It is working fine, but when I scan my code with the Fortify Static Code Analyzer, it reports an "Insecure Randomness" issue.

I know another method to generate random numbers is window.crypto.random(); but window.crypto is not supported in all browsers.

Can anybody explain how to fix this issue?

J0e3gan
  • 8,570
  • 9
  • 52
  • 78
tajMahal
  • 408
  • 6
  • 18
  • 39

0 Answers0