From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jesper Harder Newsgroups: gmane.emacs.help Subject: Re: UUIDGEN in lisp Date: Mon, 16 Feb 2004 18:10:04 +0100 Organization: http://purl.org/harder/ Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1076952505 8507 80.91.224.253 (16 Feb 2004 17:28:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Feb 2004 17:28:25 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 16 18:28:13 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AsmXV-0003Wt-01 for ; Mon, 16 Feb 2004 18:28:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AsmTb-0008S0-P0 for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Feb 2004 12:24:11 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: ^RrvqCr7c,P$zTR:QED"@h9+BTm-"fjZJJ-3=OU7.)i/K]<.J88}s>'Z_$r; List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16910 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16910 Brad Collins writes: > I've looked this up in the elisp manual but don't really understand > what is going on. I noticed in the original script that the third > field always would begin with the number four. Yes, it should be 4. A random UUID is 128 bits, but only 122 bits are random. It's generated according to this algorithm[1]: ,---- | The version 4 UUID is meant for generating UUIDs from truly-random or | pseudo-random numbers. | | The algorithm is as follows: | | . Set the 2 most significant bits (bits numbered 6 and 7) of the | clock_seq_hi_and_reserved to 0 and 1, respectively. | | . Set the 4 most significant bits (bits numbered 12 to 15 inclusive) | of the time_hi_and_version field to the 4-bit version number | corresponding to the UUID version being created, as shown in the | table above. [0 1 0 0] | | . Set all the other bits to randomly (or pseudo-randomly) chosen | values. `---- The six non-random bits identify which kind of UUID it is, time-based, random-based etc. > What does `logior' and `logand' actually do in the script They set the non-random bits. > and what does the string #B01000000 mean? It is read syntax for writing numbers in base 2. `#B01000000' is the same as the number 64. [1] http://hegel.ittc.ukans.edu/topics/internet/internet-drafts/draft-l/draft-leach-uuids-guids-01.txt