The Rainbow codes seem random, because largely they were, and by design. In WW2, the allies correctly guessed the function of some of the German kit purely by it's name. For example, it was correctly assumed that the Wotan (Odin) nav system had one transmitter as the mythical god only had one eye. There was a concerted effort to make sure the same mistakes weren't made.