def get_checker(service, filepath): if service.fs.isfile(filepath): checksum = DataAPI.hash_file( service.fs.getsyspath(filepath))['checksum'] else: checksum = None def check(chk): return chk['checksum'] == checksum return check
def hasher(f): return DataAPI.hash_file(f)