MCPcopy Create free account
hub / github.com/Roy3838/Observer / randomIndex

Function randomIndex

app/src/utils/whitelistCode.ts:43–47  ·  view source on GitHub ↗
(max: number)

Source from the content-addressed store, hash-verified

41];
42
43function randomIndex(max: number): number {
44 const arr = new Uint32Array(1);
45 crypto.getRandomValues(arr);
46 return arr[0] % max;
47}
48
49/** A stable, human-typeable whitelist code, e.g. "tree-book-shower-golden". */
50export function generateWhitelistCode(): string {

Callers 1

generateWhitelistCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected