Support Forums
Password Generator - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Ruby and Ruby on Rails (https://www.supportforums.net/forumdisplay.php?fid=55)
+---- Thread: Password Generator (/showthread.php?tid=5380)

Pages: 1 2


Password Generator - nevets04 - 03-23-2010

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 ""



RE: Password Generator - Julie - 05-09-2010

Sorry for bumping, but this is useful thanks !


RE: Password Generator - Gutfighter - 05-20-2010

I'll try it. Thanks for it ;)


RE: Password Generator - alfonzo1955 - 05-23-2010

I will try for sure. Thanks for the share.


RE: Password Generator - Robbieava - 05-23-2010

(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


RE: Password Generator - Statics - 05-23-2010

Thank you man, I am going to check it out.


RE: Password Generator - Marik™ - 06-18-2010

This is very usefull thanks for the source code.


RE: Password Generator - Ḱø♭ε Ḃґƴαηт - 10-06-2010

I am trying now, but so far it seems like there have been good results.


RE: Password Generator - Arеs - 11-01-2010

I'm going to check and test it out soon, but thanks for sharing. Much appreciated!


RE: Password Generator - Bursihido - 12-13-2010

Good work keep it up