Closed ThomasKundera closed 9 months ago
.to_bytes() fixed it: BitArray(random.getrandbits(128).to_bytes(16,'big'))
Yes, getrandbits
returns an integer, so it was trying to create a bitstring of that many bits long (which is very long!). So the failure was expected.
Hi,
Using bitstring-4.1.2-py3-none-any.whl this simple code fails:
Is this expected? Thanks.
TK.