def METHOD_NAME(self, digest, filename, digest_blocks=128):
    """
    Calculates the hash hexadecimal digest for a given file.
    :param func digest: Digest function for hash calculation
    :param str filename: File to compute
    :param int digest_blocks: Number of blocks processed at a time
    """
    chunk_size = digest_blocks * digest.block_size
    with open(filename, 'rb') as source:
        for chunk in iter(lambda: source.read(chunk_size), b''):
            digest.update(chunk)
    return digest.hexdigest()