public
Last active

Password Generator 2

  • Download Gist
password_generator_2.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11
def generatePassword(pwLength, charArray)
len = charArray.length
(1..pwLength).map do
charArray[rand(len)]
end.join
end
 
numbers = (1..9).to_a
alphabetLowerCase = ("a".."z").to_a
alphabetUpperCase = ("A".."Z").to_a
allPossibleChars = (33..126).map{|a| a.chr}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.