(self, algorithm, filename)
hash calculation using hashlib
hash calculation using hashlib
hash calculation using hashlib
def _hashlib(self, algorithm, filename):
        """hash calculation using hashlib"""
        try:
            with open(filename, "rb") as filep:
                for chunk in iter(lambda: filep.read(4096), b""):
                    algorithm.update(chunk)
            return algorithm.hexdigest()
        except (IOError, OSError):
            return ""
def _hashlib ( self , algorithm , filename ) : try : with open ( filename , "rb" ) as filep : for chunk in iter ( lambda : filep . read ( 4096 ) , b"" ) : algorithm . update ( chunk ) return algorithm . hexdigest ( ) except ( IOError , OSError ) : return ""