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,740
  • 10
  • 53
  • 80
tajMahal
  • 418
  • 6
  • 18
  • 40

0 Answers0