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

Function getRandomUint8

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

Source from the content-addressed store, hash-verified

1028 const u8s = new Uint8Array(maxId8);
1029 let id8 = maxId8;
1030 const getRandomUint8 = () => {
1031 if (id8 >= maxId8) {
1032 crypto.getRandomValues(u8s);
1033 id8 = 0;
1034 }
1035
1036 const result = u8s[id8];
1037 id8++;
1038 return result;
1039 };
1040
1041 Reflect.defineProperty(Habitat.Random, "Uint8", {
1042 get: getRandomUint8,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected