Created
September 14, 2010 09:57
-
-
Save bartvandendriessche/578817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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