module Bundler::SecureRandom
def bytes(n)
Returns a random binary string containing +size+ bytes.
def bytes(n) return gen_random(n) end
def gen_random_openssl(n)
def gen_random_openssl(n) return OpenSSL::Random.random_bytes(n) end
def gen_random_urandom(n)
def gen_random_urandom(n) ret = Random.urandom(n) unless ret raise NotImplementedError, "No random device" end unless ret.length == n raise NotImplementedError, "Unexpected partial read from random device: only #{ret.length} for #{n} bytes" end ret end