Random Password Generator in Ruby

Random Password Generator in Ruby

Source code :


characters = ('a'..'z').to_a + ('0'..'9').to_a + ('A'..'Z').to_a + ('!'..'?').to_a
 

(0..18).each do
   print characters[rand(characters.size)]
end

Output :

CcA)nMxx5n&>vu/;Y

Notes :

Each and everytime when you run the script, It will generate a new random number.


Output :


                

Comments :