emacs-devel
[Top][All Lists]
Advanced

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

Re: Should Emacs provide a uuid function?


From: Ken Raeburn
Subject: Re: Should Emacs provide a uuid function?
Date: Mon, 25 Apr 2011 03:21:23 -0400

On Apr 25, 2011, at 00:37, Stephen J. Turnbull wrote:
> I have to agree with Yidong; there's no good reason not to inline
> 
>    (shell-command-to-string "uuidgen")
> 
> in any of the applications you've mentioned if you want an
> uuidgen-format UUID.

How widespread is the uuidgen program these days?  Several systems I just 
checked have it, but it's not a program I'd been aware of.  Though, at least 
one version I ran across generates (by default?) the information-revealing 
"version 1" format that encodes the machine's MAC address, and while some 
versions have options to control which form is generated, not all do.

Using the version-4 random-number-based form described in wikipedia, it would 
probably be faster to just suck in 16 bytes from /dev/urandom or other good 
pseudo-random number source (which is a different portability question) and 
format the string directly.  I wouldn't consider the elisp 'random' function to 
be remotely good enough though.

Ken


reply via email to

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