Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math.random() usage #1315

Closed
swetha8612 opened this issue Dec 15, 2023 · 1 comment
Closed

Math.random() usage #1315

swetha8612 opened this issue Dec 15, 2023 · 1 comment

Comments

@swetha8612
Copy link

As part of our company's security policy, we run all our application through fortify scan. Fortify scan raised a flag in a couple of places where Math.random() has been used. It is suggesting to replace with window.crypto.getRandomValues(new Uint32Array(10))[0]. Could you please have a look. Thank you.

@zloirock
Copy link
Owner

It's used in one place as a part of uniq key generation. It can't be replaced with window.crypto.getRandomValues(new Uint32Array(10))[0] since in almost all cases it's usage in ancient engines where crypto.getRandomValues and even Uint32Array are not available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants