MCPcopy Create free account
hub / github.com/dfinity/cancan / randomize

Function randomize

scripts/seed.ts:225–227  ·  view source on GitHub ↗
(num)

Source from the content-addressed store, hash-verified

223}
224
225function randomize(num) {
226 return Math.floor(Math.random() * num);
227}
228function sample(array) {
229 return array[randomize(array.length)];
230}

Callers 2

sampleFunction · 0.85
multiSampleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected