Skip to content

Instantly share code, notes, and snippets.

@onigra
Created August 28, 2012 01:53
Show Gist options
  • Save onigra/3494214 to your computer and use it in GitHub Desktop.
Save onigra/3494214 to your computer and use it in GitHub Desktop.
Make Random Password(コマンドラインから桁数を指定するパターン)
def makepassword (lengs)
value = ("a".."z").to_a + ("A".."Z").to_a + (0..9).to_a
return value.sample(lengs).join
end
puts makepassword(ARGV[0].to_i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment