From: Tommy Nordgren Date: 2008-09-02T07:56:00+09:00 Subject: Re: generate uuid On 1 sep 2008, at 23.48, James Gray wrote: > On Sep 1, 2008, at 4:27 PM, Ezra Zygmuntowicz wrote: > >> On Aug 31, 2008, at 6:12 PM, Heesob Park wrote: >> >>> 2008/8/28 Newb Newb : >>>> How Can I generate uuid ? any references or Ideas could You people >>>> suggest.I have not even heard about it? >>> >>> You get get UUID on the WEB like this: >>> >>> require 'open-uri' >>> uuid = open('http://www.famkruithof.net/uuid/uuidgen'). >>> read.scan(/

([-[:alnum:]]+)<\/h3>/).to_s >>> puts uuid >>> >>> Regards, >>> >>> Park Heesob >> >> >> One thing I;ve found is that all of the UUID generators are >> painfully slow if you need to make a bunch of uuid's. > > My favorite trick is: > > uuid = `uuidgen`.strip > > It has always been fast enough for my needs. > > James Edward Gray II > > The variation I use is uuid = "x_#{`uuidgen`.strip}" The advantage is that the generated uuid is always suitable as an xml ID ------------------------------------------------------ "Home is not where you are born, but where your heart finds peace" - Tommy Nordgren, "The dying old crone" tommy.nordgren@comhem.se