* Vetrivel Vetrivel <vetrivel.bksys / gmail.com> wrote: > > I want to create new unique id in ruby.I have used the following > coding.But I don''t know whether it works perfectly or not. > > t = Time.new > p "%10.5f" % t.to_f > > does it give unique value always.I you know some other way ,please say > to create unique id . UUIDis a standard way of constructing unique identifiers, and a Ruby libraryexist already, so unless you require the identifiers to be integers, I suggest you use that. [1] http://en.wikipedia.org/wiki/UUID [2] http://wiki.github.com/assaf/uuid -- Lars Haugseth "If anyone disagrees with anything I say, I am quite prepared not only to retract it, but also to deny under oath that I ever said it." -Tom Lehrer