Generate random bitstring helper