@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
17 lines (13 loc) • 425 B
JavaScript
import {randomUint8} from "./randomUint8.js";
/**
* Fill array with random byte values (0..255 integers)
* @param {Uint8Array} result
* @param {number} result_offset
* @param {function():number} random
* @param {number} count
*/
export function randomBytes(result, result_offset, random, count) {
for (let i = 0; i < count; i++) {
result[result_offset + i] = randomUint8(random);
}
}