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

Method nextInteger

src/Random.js:53–55  ·  view source on GitHub ↗

* Returns next integer in given range [min-max]. * @param {number} min Minimum integer (inclusive) * @param {number} max Maximum integer (inclusive) * @return {number}

(min, max)

Source from the content-addressed store, hash-verified

51 * @return {number}
52 */
53 nextInteger (min, max) {
54 return Math.floor(this.next() * (max - min + 1)) + min
55 }
56
57 /**
58 * Returns next given number of bytes.

Callers 7

nextBytesMethod · 0.95
nextChoiceMethod · 0.95
shuffleMethod · 0.80
constructorMethod · 0.80
randomizeShiftValueMethod · 0.80
randomizeValueMethod · 0.80

Calls 1

nextMethod · 0.95

Tested by

no test coverage detected