Scramble String Algorithm

A scrambler replaces sequences (referred to as whitening sequences) into other sequences without remove undesirable sequences, and as a consequence it changes the probability of occurrence of vexatious sequences. Clearly it is not foolproof as there are input sequences that yield all-zeros, all-ones, or other undesirable periodic output sequences.

Scramble String source code, pseudocode and analysis