diff options
| author | Leo Liu | 2011-06-21 16:55:22 +0800 |
|---|---|---|
| committer | Leo Liu | 2011-06-21 16:55:22 +0800 |
| commit | 7f3f739fa4e1351a5b8a2dcd290f79c2e3baba38 (patch) | |
| tree | e30470b57676daad3c70b40a6725707473ca2c50 /lisp | |
| parent | bd168c0651be4fd71141ba19d54389b26258e5bb (diff) | |
| download | emacs-7f3f739fa4e1351a5b8a2dcd290f79c2e3baba38.tar.gz emacs-7f3f739fa4e1351a5b8a2dcd290f79c2e3baba38.zip | |
New primitive secure-hash supporting md5, sha-1 and sha-2
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/subr.el | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0ab00336fe5..a31868f4ed1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2011-06-21 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * subr.el (sha1): Implement sha1 using secure-hash. | ||
| 4 | |||
| 1 | 2011-06-21 Martin Rudalics <rudalics@gmx.at> | 5 | 2011-06-21 Martin Rudalics <rudalics@gmx.at> |
| 2 | 6 | ||
| 3 | * window.el (display-buffer-alist): In default value do not | 7 | * window.el (display-buffer-alist): In default value do not |
diff --git a/lisp/subr.el b/lisp/subr.el index b328b7e17b7..4d2f3b1808c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2600,6 +2600,14 @@ Otherwise, return nil." | |||
| 2600 | (get-char-property (1- (field-end pos)) 'field) | 2600 | (get-char-property (1- (field-end pos)) 'field) |
| 2601 | raw-field))) | 2601 | raw-field))) |
| 2602 | 2602 | ||
| 2603 | (defun sha1 (object &optional start end binary) | ||
| 2604 | "Return the SHA1 (Secure Hash Algorithm) of an OBJECT. | ||
| 2605 | OBJECT is either a string or a buffer. Optional arguments START and | ||
| 2606 | END are character positions specifying which portion of OBJECT for | ||
| 2607 | computing the hash. If BINARY is non-nil, return a string in binary | ||
| 2608 | form." | ||
| 2609 | (secure-hash 'sha1 object start end binary)) | ||
| 2610 | |||
| 2603 | 2611 | ||
| 2604 | ;;;; Support for yanking and text properties. | 2612 | ;;;; Support for yanking and text properties. |
| 2605 | 2613 | ||