cr

crypto-rand

Leverages nodejs' built-in crypto module for better randomness.

Showing:

Popularity

Downloads/wk

2.2K

GitHub Stars

0

Maintenance

Last Commit

9yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

crypto-rand

JavaScript's Math.random is not so random. Node.js offers a good source of randomness with it's crypto library. However, crypto deals only in byte streams. Enter crypto-rand, a nice little library that gives 48 bits of delicous randomness.

API

  • .rand(): a random double on [0,1)
  • .randRange(n): an integer which is the floor of a double on [0,n)
  • .randInt(min, max): an integer which is the floor of a double on [min,max+1)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial