Skip to content

Instantly share code, notes, and snippets.

@entp
Created September 30, 2008 19:08
Show Gist options
  • Save entp/13919 to your computer and use it in GitHub Desktop.
Save entp/13919 to your computer and use it in GitHub Desktop.
module TokenGenerator
@@chars = (('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0)
@@char_size = @@chars.size
extend self
def generate_simple
(1..8).collect { |a| @@chars[rand(@@char_size)] }.join
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment