News for hackers. Stuff that matters.
Re:Random Numbers in Bash by masklinn on Monday March 27, 2023 @11:41AM (#35328127)
> The go-to source for randomness in Linux is /dev/urandom, is it not?

AFAIK it's the true source of randomness in any unix.

> I’m not sure the best way to make use of it as a source of random decimals — there are surely a dozen ways to do so — but this works:

`od(1)` will do binary to binary to decimal:

    > head -c4 /dev/urandom | od -An -vtu4
               4119929390                                                

    > head -c4 /dev/urandom | od -An -vtu4
               3540752584                                                

    > head -c4 /dev/urandom | od -An -vtu4
                998126897

There are no comments on this comment yet.