Adds Redmine::Utils.random_hex for generating a random hex string.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9071 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -33,6 +33,13 @@ module Redmine
|
||||
ActionController::AbstractRequest.relative_url_root=arg
|
||||
end
|
||||
end
|
||||
|
||||
# Generates a n bytes random hex string
|
||||
# Example:
|
||||
# random_hex(4) # => "89b8c729"
|
||||
def random_hex(n)
|
||||
ActiveSupport::SecureRandom.hex(n)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user