JSPM

csprng-num

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q19850F
  • License ISC

Create cryptographically secure random numbers

Package Exports

  • csprng-num
  • csprng-num/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (csprng-num) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

this code generates a cryptographic secure random number in the range 0 and 1 and prints it to the console. if you give it some paramaters it will generate a random number in the range of the first parameter and the second parameter. it contains an async function that will do exactly the same thing but it will wait for the result.

you can set more or less bytes by callin the funtion setBytes(n) where n is the number of bytes you want to use.

when wanting a number call Random or RandomAsync and give it the range you want to have the number in or leave it empty for a number between 0 and 1.