MCPcopy
hub / github.com/Effect-TS/effect / randomInteger

Function randomInteger

packages/effect/src/internal/stm/tRandom.ts:21–25  ·  view source on GitHub ↗
(state: Random.PCGRandomState)

Source from the content-addressed store, hash-verified

19) as TRandom.TRandomTypeId
20
21const randomInteger = (state: Random.PCGRandomState): [number, Random.PCGRandomState] => {
22 const prng = new Random.PCGRandom()
23 prng.setState(state)
24 return [prng.integer(0), prng.getState()]
25}
26
27const randomIntegerBetween = (low: number, high: number) => {
28 return (state: Random.PCGRandomState): [number, Random.PCGRandomState] => {

Callers

nothing calls this directly

Calls 3

setStateMethod · 0.95
integerMethod · 0.95
getStateMethod · 0.95

Tested by

no test coverage detected