Is 32K a limitation of the standard rand function? I figured that in my installation (v5.8.8 built for i486-linux-gnu-thread-multi) rand works for given numbers up to 2**32. But I couldn't find any documentation for the limit. A 32 bit limitation seems logical, however. In my case I needed random hex numbers with 2**N limits, so I just concatenated multiple rand calls using
. On Linux you also can read from
to get random bytes.