emacs-devel
[Top][All Lists]
Advanced

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

Re: Adding sha256 and sha512 to C?


From: Paul Eggert
Subject: Re: Adding sha256 and sha512 to C?
Date: Fri, 27 May 2011 20:58:38 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10

On 05/27/11 20:18, address@hidden wrote:
> The gnulib crypto library also has sha256 and sha512
> functions; is there any objection to adding those as well?

Sounds good, but rather than continue to add crypto functions
wouldn't it be better to have a single function parameterized by the
algorithm name?  Something like the following signature:

 (crypto-hash-function ALGORITHM OBJECT
    &optional START END CODING-SYSTEM NOERROR BINARY)

Then, we could implement the existing functions this way:

(defun md5 (object &optional start end coding-system noerror)
   (crypto-hash-function 'md5 object start end coding-system noerror nil))

(define sha1 (object &optional start end binary)
   (crypto-hash-function 'sha1 object start end nil nil binary))




reply via email to

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