3 ms·
That property is caused by the reflector, rotors themselves can shuffle randomly. The way the reflector is built in the implementation is from pairs of consecut
by charypar 12y ago
That property is caused by the reflector, rotors themselves can shuffle randomly. The way the reflector is built in the implementation is from pairs of consecutive (unique) letters of the shuffled alphabet (getting a half of the reflector) and then merging the inversion.
IMHO it's correct.
- jgrahamc 12y agoHmm. Rereading the code I believe you are correct. I'm not strong in Ruby and had misunderstood what this was doing: Reflector = Hash[*('A'..'Z').to_a.shuffle] Reflector.merge!(Reflector.invert)