示例#1
0
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
示例#2
0
def hasher(f):

    return DataAPI.hash_file(f)