import crypto from 'crypto'; export function crypto_random32() { const arr = new Uint8Array(4); const dataview = new DataView(arr.buffer); crypto.getRandomValues(arr); return dataview.getUint32(0); } export function round_to_pow2(value, multiple) { return (value + multiple - 1) & -multiple; }