4 ms·
I imagine most uses of random in Bash don't need to be that robust, but it might be worth mentioning that ${RANDOM}${RANDOM} has a lot of bias as a random numbe
by hyperpape 9y ago
I imagine most uses of random in Bash don't need to be that robust, but it might be worth mentioning that ${RANDOM}${RANDOM} has a lot of bias as a random number generator.
- zwischenzug 9y agoFair point - have updated accordingly.
- _kst_ 9y agoIf you want 30 rather than 15 bits of randomness: echo $(((RANDOM << 15) + RANDOM))
- cryptonector 9y agoIf you want random numbers in bash then use dd if=/dev/urandom ... $RANDOM is not cryptographically secure.