I have the following code:
It’s a routine from a simple crypto algo, where I’m basically combining
two arrays of data (a “sanitized” stream of data to encrypt, and a
“keystream” to obfuscate the data).
The “pattern” I’m using to combine the streams is a bit ugly, and this
is something I’ve run up against in many other projects as well.
That is, I’m stepping through one array, and then I’m “counting” to keep
track of where I am in the other array, so as to “add” the two arrays.
I know (before calling the routine) that both arrays are of the same
size, and that elements of the corresponding arrays will be added
Is there a way to make this routine prettier? More Ruby-ific?