Skip to content

Instantly share code, notes, and snippets.

@shinzui
Created December 1, 2009 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinzui/245988 to your computer and use it in GitHub Desktop.
Save shinzui/245988 to your computer and use it in GitHub Desktop.
Random Password
def random_password(size = 8)
chars = (('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0)
(1..size).collect{ chars[rand(chars.size)] }.join
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment