12345678910/** Count the number of bits needed to represent a bigint. */export function countBigIntBits(bigint: bigint): bigint { let bits = 0n while (bigint >= 2n ** bits) bits++ return bits}