from typing import Counter


def percent_repeated_blocks(text: str, block_length: int = 16) -> float:
    """
    Checks how many repeating blocks there are in the text, which is a indication/vulnerability of ECB encryption.
    :param text   The text in question we are checking for encryption.
    :param block_length The length of each block to compare for repeats, defaults to 16-bit blocks.
    :return:    A float which is the percent of blocks which repeat, a indication of ECB encryption.
    """
    # break the string down into block_length sized blocks
    blocks = [text[i:i + block_length] for i in range(0, len(text), block_length)]
    counts = list(Counter(blocks).values())
    repeats = 0
    for i in range(0, len(counts)):
        if counts[i] > 1:
            repeats += counts[i]
    return repeats / len(blocks)