Javascript: Generate a random number within a range using crypto.getRandomValues
问题 I understand you can generate a random number in JavaScript within a range using this function: function getRandomInt (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } Courtesy of Ionuț G. Stan here. What I want to know is if you can generate a better random number in a range using crypto.getRandomValues() instead of Math.random(). I would like to be able to generate a number between 0 and 10 inclusive, or 0 - 1, or even 10 - 5000 inclusive. You'll note Math.random()