MCPcopy Create free account
hub / github.com/cryptii/cryptii / next

Method next

src/Random.js:27–35  ·  view source on GitHub ↗

* Returns next number between 0 (inclusive) and 1 (exclusive). * @return {number}

()

Source from the content-addressed store, hash-verified

25 * @return {number}
26 */
27 next () {
28 if (this._crypto) {
29 // Create one random u32 integer and divide it by 2^32
30 const integers = new Uint32Array(1)
31 this._crypto.getRandomValues(integers)
32 return integers / 0x100000000
33 }
34 return Math.random()
35 }
36
37 /**
38 * Returns next float in given range [min-max[.

Callers 3

nextFloatMethod · 0.95
nextIntegerMethod · 0.95
nextBooleanMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected