[Solved] is there a way randomly separate a string into different string array and get back same same string [closed]


Assuming that the request for a “random” allocation of letters to arrays is for a pseudo-random (or, perhaps, a superficially arbitrary) allocation that is therefore reversible, one technique to do this would be to essentially use a transposition cipher.

The algorithm would then be something like:

  1. Run the transposition cipher on the input text.
  2. Split the transposed text into the arrays.

The original text would then be obtained by reversing the two steps.

(EDIT)

The transposition cipher key could consist of a stream of pseudo-random numbers from 1 to n where n is the number of strings into which the input string is to be split. Thus, an expanded algorithm would read as follows:

  1. Generate a list of pseudo-random numbers, p, of length m, where m is the length of the input string.
  2. For all i, assign the ith letter in the input string to the output string number p[i].

To reassemble the original string:

  1. For all i, obtain the ith letter in the string from the next unused letter in string number p[i].

2

solved is there a way randomly separate a string into different string array and get back same same string [closed]