From owner-freebsd-questions Wed May 24 12:38:14 2000 Delivered-To: freebsd-questions@freebsd.org Received: from lexis-nexis.com (mx02.lexis-nexis.com [207.25.178.45]) by hub.freebsd.org (Postfix) with ESMTP id 42D5237B591 for ; Wed, 24 May 2000 12:38:10 -0700 (PDT) (envelope-from matthew.temple@lexis-nexis.com) Received: from lexis-nexis.com (mailgate [138.12.44.45]) by lexis-nexis.com (8.9.3/8.9.3) with ESMTP id PAA11145; Wed, 24 May 2000 15:38:09 -0400 (EDT) Received: from lnxdayexch05.lexis-nexis.com by lexis-nexis.com (8.9.3/8.9.3) with ESMTP id PAA00850; Wed, 24 May 2000 15:37:57 -0400 (EDT) Received: by lnxdayexch05.lexis-nexis.com with Internet Mail Service (5.5.2650.21) id ; Wed, 24 May 2000 15:37:07 -0400 Message-ID: <27E4B476932BD211945B00805FE67AF5089DE1E1@lnxdayexch05.lexis-nexis.com> From: "TEMPLE, MATTHEW (LNG)" To: "'Dan Nelson'" Cc: "'freebsd-questions@freebsd.org'" , "MITZKA, JOHN (LNG)" Subject: RE: uuidgen or other GUID-generating utility Date: Wed, 24 May 2000 15:36:58 -0400 X-Mailer: Internet Mail Service (5.5.2650.21) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ok...SunOS 5.5.1 does have a uuidgen and Linux's uuidgen does not simply spit out a random string. Included below is an excerpt from the Linux man page for uuidgen. I need to generate a GUID of comparable quality on a FreeBSD web server. Does anyone on this list know if FreeBSD has equivalent functionality or, if not, where I might find source code for a uuidgen utility? Thanks... ---------------------------------------------------------------------------- ----------------------------------------------------------- UUIDGEN(1) UUIDGEN(1) NAME uuidgen - command-line utility to create a new UUID value SYNOPSIS uuidgen [ -r | -t ] DESCRIPTION The uuidgen program creates a new universally unique iden¡ tifier (UUID) using the libuuid(3) library. The new UUID can reasonably be considered unique among all UUIDs cre¡ ated on the local system, and among UUIDs created on other systems in the past and in the future. There are two types of UUID's which uuidgen can generate: time-based UUID's and random-based UUID's. By default uuidgen will generate a random-based UUID if a high-qual¡ ity random number generator is present. Otherwise, it will chose a time-based UUID. It is possible to force the generation of one of these two UUID types by using the -r or -t options. OPTIONS -r Generate a random-based UUID. This method creates a UUID consisting mostly of random bits. It requires that the operating system have a high quality random number generator, such as /dev/ran¡ dom. -t Generate a time-based UUID. This method creates a UUID based on the system clock plus the system's ethernet hardware address, if present. ... > -----Original Message----- > From: Dan Nelson [SMTP:dnelson@emsphone.com] > Sent: Wednesday, May 24, 2000 3:05 PM > To: TEMPLE, MATTHEW (LNG) > Cc: 'freebsd-questions@freebsd.org' > Subject: Re: uuidgen or other GUID-generating utility > > In the last episode (May 24), TEMPLE, MATTHEW (LNG) said: > > I need a globally unique ID, like 28eea00e-a872-491e-8848-a9b8daf3314b. > > Linux and Solaris have a utility called uuidgen that spits them out. > > Solaris doesn't have anything like that (on 2.6 at least), and Linux's > uuidgen simply generates a random string. > > This should do what you want: > > printf "%s%s-%s-%s-%s-%s%s%s\n" `jot -r -w "%04x" 8 0 65536` > > -- > Dan Nelson > dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message