MCPcopy
hub / github.com/nusu/avvvatars / randomNumber

Function randomNumber

src/lib/random.ts:23–32  ·  view source on GitHub ↗
(opts: GenerateRandom)

Source from the content-addressed store, hash-verified

21
22
23export default function randomNumber(opts: GenerateRandom){
24 const { value, min, max } = opts
25
26 const prepareSeed = new AleaGen(value)
27 const seedOutput = prepareSeed.s1 * 10000000
28
29 const mersenne = new MersenneTwister(seedOutput)
30
31 return minMax({random: mersenne.random(), min, max})
32}

Callers

nothing calls this directly

Calls 1

minMaxFunction · 0.85

Tested by

no test coverage detected