use BigInt maxBits() and clearBit() in random()