5 ms·
require "securerandom" module SecureRandom F = File.open("/dev/urandom") def self.random_bytes(n = nil) F.read(n || 16) end end
by infraruby 10y ago
require "securerandom"
module SecureRandom
F = File.open("/dev/urandom")
def self.random_bytes(n = nil)
F.read(n || 16)
end
end
- goldbrick 10y agoWhy not just make the argument default to 16? Is something non-obvious going on?