import requests
import hashlib


def get_hash(resource_url):
    """ Access the URL provided and calculate an MD5 hash of whatever is returned.
    Throw an exception, if the URL is not accessible.
    """
    req = requests.get(resource_url, stream=True)
    m = hashlib.md5()
    for chunk in req.iter_content(chunk_size=1024):
        if chunk:
            m.update(chunk)
    return m.hexdigest()