;;; sha1.el --- SHA1 Secure Hash Algorithm.
-;; Copyright (C) 1999 Shuhei KOBAYASHI
+;; Copyright (C) 1999, 2001 Free Software Foundation, Inc.
;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
;; Keywords: SHA1, FIPS 180-1
;;; Code:
(defvar sha1-dl-module
- (if (and (fboundp 'sha1-string)
- (subrp (symbol-function 'sha1-string)))
- nil
- (if (fboundp 'dynamic-link)
- (let ((path (expand-file-name "sha1.so" exec-directory)))
- (and (file-exists-p path)
- path)))))
+ (cond
+ ((and (fboundp 'sha1)
+ (subrp (symbol-function 'sha1)))
+ nil)
+ ((fboundp 'dynamic-link)
+ ;; Should we take care of `dynamic-link-path'?
+ (let ((path (expand-file-name "sha1.so" exec-directory)))
+ (if (file-exists-p path)
+ path
+ nil)))
+ (t
+ nil)))
(cond
- (sha1-dl-module
- ;; Emacs with DL patch.
+ ((and (stringp sha1-dl-module)
+ (file-exists-p sha1-dl-module))
(require 'sha1-dl))
(t
(require 'sha1-el)))
-(defalias 'sha1-encode 'sha1-string)
-(defalias 'sha1-encode-binary 'sha1-string)
-
(provide 'sha1)
;;; sha1.el ends here