Advertisement
ibobah

Little Easy Ruby Password Generator

May 11th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.17 KB | None | 0 0
  1. def passwd_gen(len)
  2.     a = ('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a + '!@#$%^&*()_+~[]{},.<>'.chars.to_a
  3.     return (0..len).to_a.map{|x| a[rand(a.length)]}.join
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement