X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fflim.git;a=blobdiff_plain;f=hmac-sha1.el;h=2e97b2bf15b3e29d967215dc8936c65cd21fb190;hp=ab4f109bca766c84f8ed82b0c10540477d1ee7f7;hb=refs%2Fheads%2Fflim-1_14-rfc2231-encoder;hpb=85bf0cd47a81947bf45ca834d071e902632109f3 diff --git a/hmac-sha1.el b/hmac-sha1.el index ab4f109..2e97b2b 100644 --- a/hmac-sha1.el +++ b/hmac-sha1.el @@ -19,8 +19,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -67,14 +67,19 @@ (require 'hex-util) ; (decode-hex-string STRING) (require 'sha1) ; expects (sha1 STRING) -;;; For consintency with hmac-md5.el, we define this function here. -(or (fboundp 'sha1-binary) - (defun sha1-binary (string) - "Return the SHA1 of STRING in binary form." - (decode-hex-string (sha1 string)))) +;; To share *.elc files between Emacs w/ and w/o DL patch, +;; this check must be done at load-time. +(cond + ((fboundp 'sha1-binary) + ;; do nothing. + ) + (t + (defun sha1-binary (string) + "Return the SHA1 of STRING in binary form." + (decode-hex-string (sha1 string))))) (define-hmac-function hmac-sha1 sha1-binary 64 20) ; => (hmac-sha1 TEXT KEY) -;; (define-hmac-function hmac-sha1-96 sha1-binary 64 20 96) +(define-hmac-function hmac-sha1-96 sha1-binary 64 20 96) (provide 'hmac-sha1)