summaryrefslogtreecommitdiff
path: root/src/fns.c
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2019-09-16 23:42:56 +0200
committerStefan Kangas <stefankangas@gmail.com>2019-10-04 17:30:57 +0200
commitef8fadf8c1399b4ce7086141ebf96610b6475df2 (patch)
treeab17fa1d761d73b67d028029cbd607fbb0e11b4b /src/fns.c
parentdd3592564aaaee15077800a093c9e04f5da898dc (diff)
downloademacs-ef8fadf8c1399b4ce7086141ebf96610b6475df2.tar.gz
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/fns.c')
-rw-r--r--src/fns.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fns.c b/src/fns.c
index b800f1c47fe..fa52e5e1978 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -5081,7 +5081,7 @@ make_digest_string (Lisp_Object digest, int digest_size)
DEFUN ("secure-hash-algorithms", Fsecure_hash_algorithms,
Ssecure_hash_algorithms, 0, 0, 0,
- doc: /* Return a list of all the supported `secure_hash' algorithms. */)
+ doc: /* Return a list of all the supported `secure-hash' algorithms. */)
(void)
{
return list (Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512);
@@ -5388,7 +5388,12 @@ anything security-related. See `secure-hash' for alternatives. */)
DEFUN ("secure-hash", Fsecure_hash, Ssecure_hash, 2, 5, 0,
doc: /* Return the secure hash of OBJECT, a buffer or string.
ALGORITHM is a symbol specifying the hash to use:
-md5, sha1, sha224, sha256, sha384 or sha512.
+- md5 corresponds to MD5
+- sha1 corresponds to SHA-1
+- sha224 corresponds to SHA-2 (SHA-224)
+- sha256 corresponds to SHA-2 (SHA-256)
+- sha384 corresponds to SHA-2 (SHA-384)
+- sha512 corresponds to SHA-2 (SHA-512)
The two optional arguments START and END are positions specifying for
which part of OBJECT to compute the hash. If nil or omitted, uses the