import hashlib


def md5_hash(filepath):
    """Get md5 hash of a file

    Parameters
    ----------
    filepath : str
        Path of file

    Returns
    -------
    str
        md5 hash, hexadecimal number
    """
    m = hashlib.md5()
    try:
        with open(filepath, 'rb') as f_in:
            while True:
                data = f_in.read(1024)
                if not data:
                    break
                m.update(data)
    except (OSError, IOError) as e:
        pass
    return m.hexdigest()