Re:Ruby Bug: SecureRandom should try /dev/urandom first
by wrs on Wednesday May 04, 2016 @12:55AM
(#11626285)
To make this discussion really useful: what's the easiest way for a Ruby application to make SecureRandom use /dev/urandom, without waiting for Ruby-core to be convinced?
[ Parent
| on HN ]
Re:Ruby Bug: SecureRandom should try /dev/urandom first
by infraruby on Wednesday May 04, 2016 @09:01AM
(#11627989)
require "securerandom"
module SecureRandom
F = File.open("/dev/urandom")
def self.random_bytes(n = nil)
F.read(n || 16)
end
end
Re:Ruby Bug: SecureRandom should try /dev/urandom first
by goldbrick on Wednesday May 04, 2016 @10:18AM
(#11628510)
Why not just make the argument default to 16? Is something non-obvious going on?
Re:Ruby Bug: SecureRandom should try /dev/urandom first
by infraruby on Wednesday May 04, 2016 @10:32AM
(#11628608)
The caller may pass nil explicitly.