If you need unique values, why don't you use the current date\time
require 'date'
date_and_time = Time.now.asctime
Aidy
Rand(10)
will return a random number (like 1, 2)
rand() returns a random decimal (like 0.6891121414121)
rand(9999) returns random digits (like 3212)
pick a random item in an array
myarray = ['dog','cat','orange']
myarray[rand(myarray.length)]
output like 'cat'
google search yielded this nice for generating random lowercase letters
http://snippets.dzone.com/posts/show/4169
Array.new(6) { (rand(122-97) + 97).chr }.join
Output like "aydshg"
Hope that helps.
Leigh
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 270.4.1/1514 - Release Date: 6/23/2008 7:17 AM
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 270.4.1/1514 - Release Date: 6/23/2008 7:17 AM