This post addresses a question that shares similarities with the topic discussed in Generating cryptographically secure pseudorandom numbers in JavaScript?.
Utilizing JavaScript within a browser:
An experimental API available in Firefox and Chrome, titled window.crypto.getRandomValues
, enables this functionality.
However, employing other libraries for random number generation within a browser environment poses challenges due to the difficulty of gathering sufficient entropy. Consequently, these libraries may exhibit prolonged startup times or yield randomness of substandard quality.
Several options for random number generator libraries include:
The first two alternatives likely satisfy your licensing criteria, as the BSD license is characterized by its permissive nature. The third option has been included for comprehensive purposes.
In the context of node.js:
Referencing crypto.randomBytes