[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UUIDGEN in lisp

From: Brad Collins
Subject: Re: UUIDGEN in lisp
Date: Mon, 16 Feb 2004 20:47:17 +0700
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (windows-nt)

Fantastic!  Just as you said, moving (random t) outside the function
allows you to generate as many as you please.  This is very helpful
for assigning ids to a large list of items at the same time.  I don't
know how many you can assign at the same time (the spec says 10
million a unique ids in a second per machine).  I wouldn't want to put
this little script to any test that big, but I would think it should
be okay for assigning a couple hundred or even a couple thousand items
at a time in a replace funcion....

Last question -- promise :)

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.  I started changing
things around and found if I changed the following,

    (logior #B01000000 (logand #B11111111 (nth 7 bytes))))

the numbers would be begin looking random again.  What does `logior'
and `logand' actually do in the script and what does the string
#B01000000 mean?  And how should they be set in this script?  The
manual completely lost me.

Sorry to keep bugging you like this but I like to understand how
things work....

BTW I've been Googling to see how good /dev/random and /dev/urandom
are on cygwin.  A number of people seem to have asked the same
question and it sounds like it's good enough for most purposes....



Brad Collins
Chenla Labs
Bangkok, Thailand

reply via email to

[Prev in Thread] Current Thread [Next in Thread]