diff options
| author | Stefan Kangas | 2019-09-16 23:42:56 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2019-10-04 17:30:57 +0200 |
| commit | ef8fadf8c1399b4ce7086141ebf96610b6475df2 (patch) | |
| tree | ab17fa1d761d73b67d028029cbd607fbb0e11b4b /src | |
| parent | dd3592564aaaee15077800a093c9e04f5da898dc (diff) | |
| download | emacs-ef8fadf8c1399b4ce7086141ebf96610b6475df2.tar.gz emacs-ef8fadf8c1399b4ce7086141ebf96610b6475df2.zip | |
Add tests for secure-hash and improve doc string (Bug#37420)
* src/fns.c (Fsecure_hash_algorithms): Fix typo.
(Fsecure_hash): Add algorithm list to doc string.
* test/src/fns-tests.el (test-secure-hash): New test.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 9 |
1 files changed, 7 insertions, 2 deletions
| @@ -5081,7 +5081,7 @@ make_digest_string (Lisp_Object digest, int digest_size) | |||
| 5081 | 5081 | ||
| 5082 | DEFUN ("secure-hash-algorithms", Fsecure_hash_algorithms, | 5082 | DEFUN ("secure-hash-algorithms", Fsecure_hash_algorithms, |
| 5083 | Ssecure_hash_algorithms, 0, 0, 0, | 5083 | Ssecure_hash_algorithms, 0, 0, 0, |
| 5084 | doc: /* Return a list of all the supported `secure_hash' algorithms. */) | 5084 | doc: /* Return a list of all the supported `secure-hash' algorithms. */) |
| 5085 | (void) | 5085 | (void) |
| 5086 | { | 5086 | { |
| 5087 | return list (Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512); | 5087 | return list (Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512); |
| @@ -5388,7 +5388,12 @@ anything security-related. See `secure-hash' for alternatives. */) | |||
| 5388 | DEFUN ("secure-hash", Fsecure_hash, Ssecure_hash, 2, 5, 0, | 5388 | DEFUN ("secure-hash", Fsecure_hash, Ssecure_hash, 2, 5, 0, |
| 5389 | doc: /* Return the secure hash of OBJECT, a buffer or string. | 5389 | doc: /* Return the secure hash of OBJECT, a buffer or string. |
| 5390 | ALGORITHM is a symbol specifying the hash to use: | 5390 | ALGORITHM is a symbol specifying the hash to use: |
| 5391 | md5, sha1, sha224, sha256, sha384 or sha512. | 5391 | - md5 corresponds to MD5 |
| 5392 | - sha1 corresponds to SHA-1 | ||
| 5393 | - sha224 corresponds to SHA-2 (SHA-224) | ||
| 5394 | - sha256 corresponds to SHA-2 (SHA-256) | ||
| 5395 | - sha384 corresponds to SHA-2 (SHA-384) | ||
| 5396 | - sha512 corresponds to SHA-2 (SHA-512) | ||
| 5392 | 5397 | ||
| 5393 | The two optional arguments START and END are positions specifying for | 5398 | The two optional arguments START and END are positions specifying for |
| 5394 | which part of OBJECT to compute the hash. If nil or omitted, uses the | 5399 | which part of OBJECT to compute the hash. If nil or omitted, uses the |