import hashlib


def file_hash(file_path):
    """ Compute the md5 hash of a file """

    digest = hashlib.md5()
    with open(file_path, 'rb') as fp:
        for chunk in iter(lambda: fp.read(4096), b''):
            digest.update(chunk)

    return digest.hexdigest()