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?