import hashlib


def checksum(filepath, hcnstrctr=hashlib.md5, enc="utf-8"):
    """Compute the checksum of given file, `filepath`

    :raises: OSError, IOError
    """
    return hcnstrctr(open(filepath).read().encode(enc)).hexdigest()