title: Erlang generate random binary
body: <p>What is the most efficient way to generate a random binary object given a number of bits? I understand that the <code>crypto:rand_bytes</code> function would be an option, but the bit count must not necessarily be a multiply of 8. </p>