MCPcopy Create free account
hub / github.com/TodePond/ScreenPond / getRandomUint32

Function getRandomUint32

libraries/habitat-embed.js:1050–1059  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1048 const u32s = new Uint32Array(maxId32);
1049 let id32 = maxId32;
1050 const getRandomUint32 = () => {
1051 if (id32 >= maxId32) {
1052 crypto.getRandomValues(u32s);
1053 id32 = 0;
1054 }
1055
1056 const result = u32s[id32];
1057 id32++;
1058 return result;
1059 };
1060
1061 Reflect.defineProperty(Habitat.Random, "Uint32", {
1062 get: getRandomUint32,

Callers 1

habitat-embed.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected