Skip to content

Instantly share code, notes, and snippets.

@bartvandendriessche
Created September 14, 2010 09:57
Show Gist options
  • Save bartvandendriessche/578817 to your computer and use it in GitHub Desktop.
Save bartvandendriessche/578817 to your computer and use it in GitHub Desktop.
# simple script to generate random keys
# You can modify the left and right attributes to be longer,
# or contain any mix of alphanumeric characters you like
# By using the String.succ method, keys will always be uniq.
# Depending on the amount of keys generated, key length may exceed the original length of left + right
@left = "0a0"
@right = "a0a"
1000.times do
(1 + rand(10)).times do
@left = @left.succ
end
(1 + rand(10)).times do
@right = @right.succ
end
puts "#{@left}#{@right}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment