Skip to content

Instantly share code, notes, and snippets.

@alexdovzhanyn
Created August 26, 2016 02:02
Show Gist options
  • Save alexdovzhanyn/f090da74af31835b42288f6d4072a17f to your computer and use it in GitHub Desktop.
Save alexdovzhanyn/f090da74af31835b42288f6d4072a17f to your computer and use it in GitHub Desktop.
characters = ('a'..'z').to_a + ('0'..'9').to_a + ["!", "@", "#", "$", "%", "^", "&", "*",]
password = ""
print "How long should your password be? "
len = gets.chomp.to_i
len.times{n = rand(0..43); password += characters[n].to_s;}
puts password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment