Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Random string generator
def random_string(length=16)
source = ("a".."z").to_a + ("A".."Z").to_a + (0..9).to_a{|e| source[rand(source.size)]}.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.