Bug #6928 ยป securerandom.patch
lib/securerandom.rb (working copy) | ||
---|---|---|
if @pid != pid
|
||
now = Time.now
|
||
ary = [now.to_i, now.nsec, @pid, pid]
|
||
OpenSSL::Random.seed(ary.to_s)
|
||
OpenSSL::Random.random_add(ary.to_s, 0.0)
|
||
@pid = pid
|
||
end
|
||
return OpenSSL::Random.random_bytes(n)
|