# HG changeset patch # User Franz Glasner # Date 1606982735 -3600 # Node ID bbf4e0f5b651f8dd11fbd7c9fe15f34dcbc91c76 # Parent a962496fc9b6fd944b078886122f3da91525afec Begin the shasum.py script diff -r a962496fc9b6 -r bbf4e0f5b651 shasum.py --- /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 ` for details. + If you cannot find LICENSE see + +: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())