from functools import reduce


def state_to_bin_hash(state):
    """
    Converts a state vector e.g. np.array((0,0,1,1,...)) to a string (reduce), then binarize, using int.
    :param state:
    :return:
    """
    return int(reduce(lambda x, y: x + str(y), state, ''),2)