通過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