Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Password Generator
#5
(03-23-2010, 10:16 PM)nevets04 Wrote:
Code:
[code]
print "How many characters do you want in your password?: "
characters = gets.chomp
puts "1) Yes"
puts "2) No"
print "Do you want numbers?: "
numbers = gets.chomp
characters = characters.to_i
numbers = numbers.to_i
if numbers == 2
    while 0 < characters
        characters = characters - 1
        password = (?a.ord + rand(26)).chr
        print password
    end
end
if numbers == 1
    characters = characters / 2
    while 0 < characters
        characters = characters - 1
        password = (?a.ord + rand(26)).chr
        passwordnumber = rand(10)
        print password, passwordnumber
    end
end
puts ""

good work friend! Blackhat
My informational thread on how to become HQ
[Image: 3af27e76.png]
"An eye for an eye and the whole world would be blind"
Reply


Messages In This Thread
Password Generator - by nevets04 - 03-23-2010, 10:16 PM
RE: Password Generator - by Julie - 05-09-2010, 03:19 PM
RE: Password Generator - by Gutfighter - 05-20-2010, 07:51 PM
RE: Password Generator - by alfonzo1955 - 05-23-2010, 01:07 PM
RE: Password Generator - by Robbieava - 05-23-2010, 01:50 PM
RE: Password Generator - by Statics - 05-23-2010, 02:03 PM
RE: Password Generator - by Zerk.Gamer.Coder - 06-18-2010, 02:42 PM
RE: Password Generator - by Arеs - 11-01-2010, 09:11 AM
RE: Password Generator - by Bursihido - 12-13-2010, 10:56 PM
RE: Password Generator - by Poppins - 12-20-2010, 01:55 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)