[Top][All Lists]

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

Re: Should Emacs provide a uuid function?

From: Stefan Monnier
Subject: Re: Should Emacs provide a uuid function?
Date: Mon, 09 May 2011 11:38:08 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> (defun secure-random-bytes (n)
>> (let ((file (cond
>> ((file-exists-p "/dev/random")  "/dev/random")
>> ((file-exists-p "/dev/urandom") "/dev/urandom")
>> (t (error "Secure random device not available")))))

> Feh.  Using platform-dependent interfaces in Lisp is not the Emacs
> way, in my book.  How about a primitive which would read from
> /dev/random or /dev/urandom if they are available, or use other
> methods if they are not?

FWIW, I don't think there's anything wrong with writing the
platform-dependent code in Elisp rather than in C.  I generally prefer
code to be written in Elisp when possible and when it's not introducing
a performance problem.


reply via email to

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