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/subr.el | |
| 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/subr.el')
| -rw-r--r-- | lisp/subr.el | 8 |
1 files changed, 8 insertions, 0 deletions
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 | ||