MCPcopy Create free account
hub / github.com/GoogleChrome/samples / randomByte

Function randomByte

mkbitmap/mkbitmap.js:2835–2840  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2833 // use a buffer to avoid overhead of individual crypto calls per byte
2834 var randomBuffer = new Uint8Array(1024), randomLeft = 0;
2835 var randomByte = () => {
2836 if (randomLeft === 0) {
2837 randomLeft = randomFill(randomBuffer).byteLength;
2838 }
2839 return randomBuffer[--randomLeft];
2840 };
2841 FS.createDevice('/dev', 'random', randomByte);
2842 FS.createDevice('/dev', 'urandom', randomByte);
2843 // we're not going to emulate the actual shm device,

Callers

nothing calls this directly

Calls 1

randomFillFunction · 0.70

Tested by

no test coverage detected