MCPcopy Create free account
hub / github.com/aiscript-dev/aiscript / fillBuffer

Method fillBuffer

src/utils/random/seedrandom.ts:16–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 this.filledBuffer = new Uint8Array(0);
15 }
16 private fillBuffer(): void {
17 this.buffer.fill(0);
18 this.buffer = this.fillBufferDirect(this.buffer);
19 this.filledBuffer = this.buffer;
20 }
21 private fillBufferDirect(buffer: Uint8Array): Uint8Array {
22 if ((buffer.length % seedRandomBlockSize) !== 0) throw new Error(`SeedRandomWrapper.fillBufferDirect should always be called with the buffer with the length a multiple-of-${seedRandomBlockSize}!`);
23 const length = buffer.length / seedRandomBlockSize;

Callers 1

generateBytesMethod · 0.95

Calls 1

fillBufferDirectMethod · 0.95

Tested by

no test coverage detected