()
| 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, |