import hashlib


def hash(file_path):
    """
    Produce a md5 hash of the file contents.
    """
    hasher = hashlib.md5()
    with open(file_path, 'rb') as file_to_hash:
        buf = file_to_hash.read()
        hasher.update(buf)
    return hasher.hexdigest()