Line data Source code
1 : import { Engine } from "../types.ts"; 2 1 : import { UINT21_MAX, UINT32_SIZE } from "../utils/constants.ts"; 3 : 4 : /** 5 : * Returns a value within [0, 0x1fffffffffffff] 6 : */ 7 0 : export function uint53(engine: Engine): number { 8 0 : const high = engine.next() & UINT21_MAX; 9 0 : const low = engine.next() >>> 0; 10 0 : return high * UINT32_SIZE + low; 11 0 : }