def xor(block_a: "str | bytes", block_b: "str | bytes"):
    """ Computes the XOR of two bytes objects.

    Args:
        block_a (str | bytes): The first block of bytes
        block_b (str | bytes): The second block of bytes

    Returns:
        bytes: The result of block_a ^ block_b
    """
    if isinstance(block_a, str): block_a = block_a.encode()
    if isinstance(block_b, str): block_b = block_b.encode()

    result = bytearray(block_a)
    for index, byte in enumerate(block_b): result[index] ^= byte
    return bytes(result)