通过window.crypto.getRandomValues获得一个大于零的随机数


window.crypto.getRandomValues(new Uint32Array(1))[0];

浏览器支持情况如下:

IE: no
IE Mobile: no

Firefox24+

Firefox Mobile: will be in 21

Safari: from 3.1

Safari Mobile: from iOS 6

Chrome: from 11

Chrome for Mobile: from 23
Android browser (before 4.0 as replaced with Chrome): no

Opera: no (though will probably get it when moving to WebKit)

Opera Mobile: no
Opera Mini: no


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM