oaktree

Quick Password Generator

Jun 15th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.38 KB | None | 0 0
  1. #! /bin/env ruby
  2.  
  3. if ARGV[0] && ARGV[0].respond_to?(:chr)
  4.    
  5.     print "[*] Quick Password Generator [*]\n\n"
  6.     print "    "
  7.  
  8.     ARGV[0].to_i.times do |x|
  9.         arr = [rand(48..57),rand(65..90),rand(97..122)].map(&:chr)
  10.         print arr[rand(0...arr.length)]
  11.     end
  12.    
  13.     print "\n\n[*] Complete.\n"
  14. else
  15.     print "[*] ERROR: No length supplied.\n"
  16.     print "[*] USAGE: ruby quick-gen.rb <length>\n"
  17. end
Add Comment
Please, Sign In to add comment