Skip to content

Instantly share code, notes, and snippets.

@leikind
Created January 28, 2012 21:50
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 leikind/1695871 to your computer and use it in GitHub Desktop.
Save leikind/1695871 to your computer and use it in GitHub Desktop.
def generate_random_pronouncable_password(size = 3)
c = %w(b c d f g h j k l m n p qu r s t v w x z ch cr fr nd ng nk nt ph pr rd sh sl sp st th tr)
v = %w(a e i o u y)
f, r = true, ''
(size * 2).times do
r << (f ? c[rand * c.size] : v[rand * v.size])
f = !f
end
r
end
p generate_random_pronouncable_password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment