import struct


def decode_string(binary_input):
    """Decode a binary uon string. Length of the string is encoded 
    on the two first bytes, the string value is utf-8 encoded on the rest.

    Args:
        binary_input (bytes): a binary uon string

    Returns:
        tuple: uon string with the decoded value, 
                and the rest of the binary
    """
    length_encoded = binary_input[0:2]
    length = struct.unpack("<H", length_encoded)[0]
    end_string_offset = length + 2

    encoded_value = binary_input[2:end_string_offset]
    rest = binary_input[end_string_offset:]

    unpack_format = f"{length}s"
    value = struct.unpack(unpack_format, encoded_value)[0]
    return value.decode("utf-8"), rest