Random Number Generation
Clone this wiki locally
Cryptography often depends on your ability to create secure numbers, but doing that correctly is surprisingly hard! RbNaCl tries to get that right for you, by using /dev/urandom on Unix-based operating systems and CryptGenRandom on Windows.
# random strings RbNaCl::Random.random_bytes(32) #=> 32 bytes of randomness, from the OS