Secure Random Number Generator – Rando.js

Category: Javascript , Recommended | October 18, 2020
Author:nastyox
Views Total:167 views
Official Page:Go to website
Last Update:October 18, 2020
License:MIT

Preview:

Secure Random Number Generator – Rando.js

Description:

Rando.js is a simple, powerful, JavaScript-powered secure random number generator for developers.

How to use it:

1. Load the latest version of the Rando.js library in the document:

  • 1.0.0: Math.random() based version.
  • 2.0.0: Cryptographically secure version
<script src="version/rando-min.js"></script>

2. Generate a floating-point number between 0 and 1.

rando();
=> 0.9360002525550916

3. Generate an integer between 0 and 10.

rando(10);
=> 3

4. Generate an integer between 10 and 100.

rando(10, 100);
=> 77

5. Generate a floating-point numbre between 2 numbers.

rando(10, 100, "float");
=> 63.18597051740682

6. It also supports strings, arrays, objects, and event jQuery elements.

rando("cssscript");
=> s
rando(["css","script","com"]);
=> {index: 1, value: "script"}
rando({name: "css", url: true, text: "script"});
=> {key: "text", value: "script"}
rando($("div"));
=> {index: 46, value: jQuery element }

7. To generate numbers in a random order, use the randoSequence() instead.

randoSequence(10) 
randoSequence(10, 100)
...

Changelog:

10/18/2020

  • Shorten “require” code.

09/20/2020

  • Human-readable cryptographically secure version.

08/17/2020

  • Correct npm installation instructions.

07/04/2020

  • Added Cryptographically secure version.

You Might Be Interested In:


Leave a Reply