def hamming_similarity(s1, s2):
    """
    Hamming string similarity, based on Hamming distance
    https://en.wikipedia.org/wiki/Hamming_distance
    :param s1:
    :param s2:
    :return:
    """
    if len(s1) != len(s2):
        return .0
    return sum([ch1 == ch2 for ch1, ch2 in zip(s1, s2)]) / len(s1)