Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
225
function
randomize(num) {
226
return
Math.floor(Math.random() * num);
227
}
228
function
sample(array) {
229
return
array[randomize(array.length)];
230
}
Callers
2
sample
Function · 0.85
multiSample
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected