Takes portion of the byte array and passes it to the function for transformation.
    Result is replaced in the byte string, new one is created.
    :param byte_str:
    :param start_idx:
    :param stop_idx:
    :param fction:
    :return:

def bytes_transform(byte_str, start_idx, stop_idx, fction):
    """
    Takes portion of the byte array and passes it to the function for transformation.
    Result is replaced in the byte string, new one is created.
    :param byte_str:
    :param start_idx:
    :param stop_idx:
    :param fction:
    :return:
    """
    return bytes_replace(byte_str, start_idx, stop_idx, fction(byte_str[start_idx:stop_idx]))