public Method

SecretKeyGenerator.generate_secret_with_urandom

Generate a random secret key with /dev/urandom. Raises SystemCallError on failure.

Source Code

# File rails_generator/secret_key_generator.rb, line 85
def generate_secret_with_urandom
  return File.read("/dev/urandom", 64).unpack("H*")[0]
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.