Guest User

Untitled

a guest
Jun 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. def random_password
  2.  
  3. c = %w( b c d f g h j k l m n p qu r s t v w x z ) +
  4. %w( ch cr fr nd ng nk nt ph pr rd sh sl sp st th tr )
  5. v = %w( a e i o u y )
  6. f, r = true, ''
  7.  
  8. 6.times do
  9. r << ( f ? c[ rand * c.size ] : v[ rand * v.size ] )
  10. f = !f
  11. end
  12.  
  13. 2.times do
  14. r << ( rand( 9 ) + 1 ).to_s
  15.  
  16. end
  17. r
  18. end
Add Comment
Please, Sign In to add comment