On 2004.03.25, Dave Bauer <[EMAIL PROTECTED]> wrote:
> I'd like to try to comform to the WebDAV specification for this, but
> that is handy to have a simple way to produce a similar result. That is,
> one application of this would be to generate valid WebDAV lock tokens.
> It also seems that HTTP e-tags also use the same type of GUID.

If you want to cheat, just generate a few hundred bytes of random data,
then compute the MD5 hash of that data.  That'll give you 128-bits of
data.  Then, just format those 128 bits into the various hex-formatted,
hyphen-separated strings that the UUID/GUID spec. wants them to be.

Mash some of the interesting bits to signify that your UUID is a Version
4 UUID (where all the bits are pretty much random) and off you go.

-- Dossy

--
Dossy Shiobara                       mail: [EMAIL PROTECTED]
Panoptic Computer Network             web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to