method

gen_random_openssl

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: SecureRandom
gen_random_openssl(n) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/securerandom.rb, line 82
    def gen_random_openssl(n)
      @pid = 0 unless defined?(@pid)
      pid = $$
      unless @pid == pid
        now = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
        OpenSSL::Random.random_add([now, @pid, pid].join(""), 0.0)
        seed = Random.urandom(16)
        if (seed)
          OpenSSL::Random.random_add(seed, 16)
        end
        @pid = pid
      end
      return OpenSSL::Random.random_bytes(n)
    end
Register or log in to add new notes.