Friday, May 17, 2024
14
rated 0 times [  17] [ 3]  / answers: 1 / hits: 16646  / 11 Years ago, tue, april 16, 2013, 12:00:00

I need to generate cryptographically secure pseudorandom numbers, in Javascript. I know about the window.crypto.getRandomValues API, which does exactly what I want. However, I also know it was introduced relatively recently (in 2011 or so).



Can I safely assume window.crypto.getRandomValues is present, or will using it introduce compatibility problems on some browsers? Are there any major (widely used) browsers which do not support window.crypto.getRandomValues (including mobile or desktop browsers), and if so, which ones do I need to worry about? I would be delighted to learn that there is enough support that I no longer need to worry about fallback methods, if that is indeed the case.


More From » web-applications

 Answers
31

Can I safely assume window.crypto.getRandomValues is present




As always it depends on your target market and will change over time. caniuse.com lists which browsers support it and calculates the browser marketshare.



Here is a summary:




  • IE 11: w/ prefix

  • IE Mobile 11: w/ prefix


  • Firefox: 21+


  • Firefox Mobile: 21+


  • Safari: from 6.1


  • Safari Mobile: 7.1


  • Chrome: 11+


  • Chrome for Mobile: 23+

  • Android browser: 4.4


  • Opera: 15+


  • Opera Mobile: 36+

  • Opera Mini: no


[#78884] Sunday, April 14, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
quentinaveryb

Total Points: 102
Total Questions: 100
Total Answers: 93

Location: Colombia
Member since Mon, May 2, 2022
2 Years ago
quentinaveryb questions
Thu, Aug 6, 20, 00:00, 4 Years ago
Fri, Jul 17, 20, 00:00, 4 Years ago
Mon, Aug 12, 19, 00:00, 5 Years ago
;