Merge `deisui-1_14_0-1'.
[elisp/flim.git] / md5.el
1 ;;; md5.el --- MD5 Message Digest Algorithm.
2
3 ;; Copyright (C) 1999 Shuhei KOBAYASHI
4
5 ;; Author: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
6 ;; Keywords: MD5, RFC 1321
7
8 ;; This file is part of FLIM (Faithful Library about Internet Message).
9
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or
13 ;; (at your option) any later version.
14
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with this program; see the file COPYING.  If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;; Examples from RFC 1321.
28 ;;
29 ;; (md5 "")
30 ;; => d41d8cd98f00b204e9800998ecf8427e
31 ;;
32 ;; (md5 "a")
33 ;; => 0cc175b9c0f1b6a831c399e269772661
34 ;;
35 ;; (md5 "abc")
36 ;; => 900150983cd24fb0d6963f7d28e17f72
37 ;;
38 ;; (md5 "message digest")
39 ;; => f96b697d7cb7938d525a2f31aaf161d0
40 ;;
41 ;; (md5 "abcdefghijklmnopqrstuvwxyz")
42 ;; => c3fcd3d76192e4007dfb496cca67e13b
43 ;;
44 ;; (md5 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
45 ;; => d174ab98d277d9f5a5611c2c9f419d9f
46 ;;
47 ;; (md5 "12345678901234567890123456789012345678901234567890123456789012345678901234567890")
48 ;; => 57edf4a22be3c955ac49da2e2107b67a
49
50 ;;; Code:
51
52 (cond
53  ((and (fboundp 'md5)
54        (subrp (symbol-function 'md5)))
55   ;; recent XEmacs has `md5' as a built-in function.
56   ;; (and 'md5 is already provided.)
57   )
58  ((and (fboundp 'dynamic-link)
59        (file-exists-p (expand-file-name "md5.so" exec-directory)))
60   ;; Emacs with DL patch.
61   (require 'md5-dl))
62  (t
63   (require 'md5-el)))
64
65 (provide 'md5)
66
67 ;;; md5.el ends here.