import hashlib


def flip_bloom_filter(string: str, bf_len: int, num_hash_funct: int):
    """
    Hash string and return indices of bits that have been flipped correspondingly.

    :param string: string: to be hashed and to flip bloom filter
    :param bf_len: int: length of bloom filter
    :param num_hash_funct: int: number of hash functions
    :return: bfset: a set of integers - indices that have been flipped to 1
    """
    # config for hashing
    h1 = hashlib.sha1
    h2 = hashlib.md5

    sha_bytes = h1(string.encode('utf-8')).digest()
    md5_bytes = h2(string.encode('utf-8')).digest()
    int1 = int.from_bytes(sha_bytes, 'big') % bf_len
    int2 = int.from_bytes(md5_bytes, 'big') % bf_len

    # flip {num_hash_funct} times
    bfset = set()
    for i in range(num_hash_funct):
        gi = (int1 + i * int2) % bf_len
        bfset.add(gi)

    return bfset