jruby

https://github.com/jruby/jruby

Ruby

JRuby, an implementation of Ruby on the JVM

Random::Formatter#alphanumeric

SecureRandom.alphanumeric generates a random alphanumeric string.

The argument _n_ specifies the length, in characters, of the alphanumeric
string to be generated.

If _n_ is not specified or is nil, 16 is assumed.
It may be larger in the future.

The result may contain A-Z, a-z and 0-9.

  p SecureRandom.alphanumeric #=> "2BuBuLf3WfSKyQbR"
  p SecureRandom.alphanumeric(10) #=> "i6K93NdqiH"

If a secure random number generator is not available,
+NotImplementedError+ is raised.

Source | Google | Stack overflow

Edit

git clone [email protected]:jruby/jruby.git

cd jruby

open lib/ruby/stdlib/securerandom.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Random--Formatter-alphanumeric-for-pr


# Commit to git

git add lib/ruby/stdlib/securerandom.rbgit commit -m "better docs for Random::Formatter#alphanumeric"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Random--Formatter-alphanumeric-for-pr

hub pull-request


# Celebrate!