Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Safari like random passwords in ruby
BASE = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
def random_string(length = 3) { BASE[rand(BASE.length)] }.join
puts { random_string }.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.