changeset 120:a548783381b6

More accurate description of --algorithm. While their: alias "3" to "3-512" (sha3-512).
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 29 Dec 2024 18:46:23 +0100
parents dd4fe912d7e9
children 2dc26a2f3d1c
files cutils/shasum.py cutils/util/__init__.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cutils/shasum.py	Sun Dec 29 18:34:22 2024 +0100
+++ b/cutils/shasum.py	Sun Dec 29 18:46:23 2024 +0100
@@ -38,7 +38,7 @@
         fromfile_prefix_chars='@')
     aparser.add_argument(
         "--algorithm", "-a", action="store", type=util.argv2algo,
-        help="1 (default), 224, 256, 384, 512, 3-224, 3-256, 3-384, 3-512, blake2b, blake2s, blake2, blake2-256, md5")
+        help="1 (default, aka sha1), 224, 256, 384, 512, 3 (alias for sha3-512), 3-224, 3-256, 3-384, 3-512, blake2b, blake2b-256, blake2s, blake2 (alias for blake2b), blake2-256 (alias for blake2b-256), md5")
     aparser.add_argument(
         "--base64", action="store_true",
         help="Output checksums in base64 notation, not hexadecimal (OpenBSD).")
--- a/cutils/util/__init__.py	Sun Dec 29 18:34:22 2024 +0100
+++ b/cutils/util/__init__.py	Sun Dec 29 18:46:23 2024 +0100
@@ -86,7 +86,7 @@
         return (hashlib.sha3_256, "SHA3-256")
     elif s in ("3-384", "sha3-384"):
         return (hashlib.sha3_384, "SHA3-384")
-    elif s in ("3-512", "sha3-512"):
+    elif s in ("3", "3-512", "sha3-512"):
         return (hashlib.sha3_512, "SHA3-512")
     elif s in ("blake2b", "blake2b-512", "blake2", "blake2-512"):
         return (get_blake2b(), "BLAKE2b")