def _sha1_for_file ( filename ) : with open ( filename , "rb" ) as fileobj : contents = fileobj . read ( ) return hashlib . sha1 ( contents ) . hexdigest ( )
python sha1 hash of a file
Return sha1 for contents of filename .
def _sha1_for_file(filename):
    """Return sha1 for contents of filename."""
    with open(filename, "rb") as fileobj:
        contents = fileobj.read()
        return hashlib.sha1(contents).hexdigest()