import hashlib


def sha256(filepath):
    """
        Function to calculate sha256 of a file in disk
        Params:
            - filepath (str): Path where the file is stored
        Return:
            - sha256 hash calculated
    """
    fd = open(filepath, 'rb')
    hasher_256 = hashlib.sha256()
    chunk = fd.read(1024)
    while chunk:
        hasher_256.update(chunk)
        chunk = fd.read(1024)

    fd.close()
    return hasher_256.hexdigest()