Skip to content

Instantly share code, notes, and snippets.

@jameshibbard
Created September 2, 2012 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameshibbard/3603168 to your computer and use it in GitHub Desktop.
Save jameshibbard/3603168 to your computer and use it in GitHub Desktop.
Password Generator 2
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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment