X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Fmd5.el;h=a246b1aa7012e18eb9c22950d7a92bc73a97fe09;hb=7d360ad9b65c2c51068117c290ebba043fe5924e;hp=8823f30c9b22ecb3ad039c5c3c19b271acaeb45a;hpb=688636e75e02be0a1c319f546ec388ed9ec10a85;p=elisp%2Fgnus.git- diff --git a/lisp/md5.el b/lisp/md5.el index 8823f30..a246b1a 100644 --- a/lisp/md5.el +++ b/lisp/md5.el @@ -360,21 +360,25 @@ Returns a vector of 16 bytes containing the message digest." c (md5-II c d a b (aref in 2) 15 '(10967 . 53947)) b (md5-II b c d a (aref in 9) 21 '(60294 . 54161))) - (aset md5-buffer 0 (md5-add (aref md5-buffer 0) a)) - (aset md5-buffer 1 (md5-add (aref md5-buffer 1) b)) - (aset md5-buffer 2 (md5-add (aref md5-buffer 2) c)) - (aset md5-buffer 3 (md5-add (aref md5-buffer 3) d)))) + (aset md5-buffer 0 (md5-add (aref md5-buffer 0) a)) + (aset md5-buffer 1 (md5-add (aref md5-buffer 1) b)) + (aset md5-buffer 2 (md5-add (aref md5-buffer 2) c)) + (aset md5-buffer 3 (md5-add (aref md5-buffer 3) d)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Here begins the merger with the XEmacs API and the md5.el from the URL ;;; package. Courtesy wmperry@spry.com ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun md5 (object &optional start end) +(defun md5 (object &optional start end coding noerror) "Return the MD5 (a secure message digest algorithm) of an object. OBJECT is either a string or a buffer. Optional arguments START and END denote buffer positions for computing the -hash of a portion of OBJECT." - (let ((buffer nil)) +hash of a portion of OBJECT. + +The optional CODING and NOERROR arguments are ignored. They are only +placeholders to ensure the compatibility with XEmacsen with file-coding or +Mule support." + (let ((buffer nil)) (unwind-protect (save-excursion (setq buffer (generate-new-buffer " *md5-work*")) @@ -391,7 +395,7 @@ hash of a portion of OBJECT." (if (<= (point-max) md5-maximum-internal-length) (mapconcat (function (lambda (node) (format "%02x" node))) - (md5-encode (buffer-substring (point-min) (point-max))) + (md5-encode (buffer-string)) "") (call-process-region (point-min) (point-max) (or shell-file-name "/bin/sh")