import hashlib


def get_sha1(fname, blocksize=2**20):
    """Gets the sha1 hash of file designated by fname (with full path)"""
    m = hashlib.sha1()
    with open(fname, 'rb') as f:
        # continually update hash until EOF
        while True:
            block = f.read(blocksize)
            if not block:
                break
            m.update(block)
    return m.hexdigest()