math-random

math-random is an isomorphic, drop-in replacement for Math.random that uses cryptographically secure random number generation, where available

Usage no npm install needed!

<script type="module">
  import mathRandom from 'https://cdn.skypack.dev/math-random';
</script>

README

math-random

math-random is an isomorphic, drop-in replacement for Math.random that uses cryptographically secure random number generation, where available

ci

install

npm install math-random

use

console.log(require('math-random')())
=> 0.584293719381094

console.log(require('math-random/is-secure'))
=> true || false

obey

CC0-1.0