ashwin3005 / password-generator

Password generator made with React
MIT License
21 stars 38 forks source link

Replaced Math.random #73

Closed wavpro closed 2 years ago

wavpro commented 2 years ago

Follow up on pull request #69, fixed probability of symbols being too low. Numbers ranging between 0.75-1 are now more common, more like the Math.random function.

netlify[bot] commented 2 years ago

Deploy Preview for create-your-password ready!

Name Link
Latest commit 0d0421848071845331f10834922a45b80fe1a707
Latest deploy log https://app.netlify.com/sites/create-your-password/deploys/63554d4de7f558000824861f
Deploy Preview https://deploy-preview-73--create-your-password.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

wavpro commented 2 years ago

Should I redo this since you accepted #74? @ashwin3005

ashwin3005 commented 2 years ago

No need, math.random works fine.

thanks a lot for your efforts

wavpro commented 2 years ago

No need, math.random works fine.

thanks a lot for your efforts

I understand that math.random 'works fine', but the mdn docs clearly state that it should never be used for security-related applications:

Note: Math.random() does not provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the [window.crypto.getRandomValues()](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) method.

It's your decision though.