changeset 1:bbf4e0f5b651

Begin the shasum.py script
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 03 Dec 2020 09:05:35 +0100
parents a962496fc9b6
children 5510a39a2d04
files shasum.py
diffstat 1 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/shasum.py	Thu Dec 03 09:05:35 2020 +0100
@@ -0,0 +1,39 @@
+r"""
+:Author:    Franz Glasner
+:Copyright: (c) 2020 Franz Glasner.
+            All rights reserved.
+:License:   BSD 3-Clause "New" or "Revised" License.
+            See :ref:`LICENSE <license>` for details.
+            If you cannot find LICENSE see
+            <https://opensource.org/licenses/BSD-3-Clause>
+:ID:        @(#) HGid$
+
+"""
+
+
+import argparse
+import hashlib
+import sys
+
+
+def main(argv=None):
+
+    aparser = argparse.ArgumentParser(
+        description="Python implementation of shasum",
+        fromfile_prefix_chars='@')
+
+    opts = aparser.parse_args(args=argv)
+
+
+def compute_digest(hashobj, instream):
+    """
+
+    :param hashobj: a :mod:`hashlib` compatible hash algorithm instance
+    :param instream: a bytes input stream to read the data to be hashed from
+    :return: the digest in hex form
+    :rtype: str
+
+    """
+    
+if __name__ == "__main__":
+    sys.exit(main())