import hashlib


def compute_file_hash(file_path, alg='md5'):
    """
    Computes the file's Hash based on specified algorithms and its given path

    Supported algorithms::

        * md5

    :param file_path: the file path from which to get hash
    :type file_path: str

    :param alg: used algorithm (MD5, SHA{1, 2, ...}, CRC, ...)
    :type alg: str

    :return: the file's hash according desired algorithm
    :rtype: str

    """
    if alg == 'md5':
        md5_obj = hashlib.md5()
        block_size = 65536
        # read chunk by chunk for big file
        with open(file_path, 'r+b') as f:
            for block in iter(lambda: f.read(block_size), ""):
                md5_obj.update(block)
        local_md5 = md5_obj.hexdigest()
        file_hash = local_md5

    else:
        raise NotImplementedError("ALGORITHM {0} NOT IMPLEMENTED!".format(alg))
    return file_hash