Random number generator (device): Difference between revisions

m
(→‎{{header|Ruby}}: added specifying RNG example)
Line 1,244:
Ruby 1.8.7 introduces the 'securerandom' library. For [[MRI]] users, this library tries to get random numbers by loading OpenSSL, or opening /dev/urandom, or calling CryptGenRandom.
 
{{works with|Ruby|1.8.7}}
<lang Ruby>require 'securerandom'
SecureRandom.random_number(1 << 32)
1,149

edits