Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 May 2000 15:36:58 -0400
From:      "TEMPLE, MATTHEW (LNG)" <matthew.temple@lexis-nexis.com>
To:        "'Dan Nelson'" <dnelson@emsphone.com>
Cc:        "'freebsd-questions@freebsd.org'" <freebsd-questions@FreeBSD.ORG>, "MITZKA, JOHN (LNG)" <JOHN.MITZKA@lexis-nexis.com>
Subject:   RE: uuidgen or other GUID-generating utility
Message-ID:  <27E4B476932BD211945B00805FE67AF5089DE1E1@lnxdayexch05.lexis-nexis.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?27E4B476932BD211945B00805FE67AF5089DE1E1>