First generate a PN sequence of your sequence type with any length. Now simply Xor the PN sequence with your streaming data at 2 times the clock frequency of your input data stream. This is what we call spreading. Now the resulting code consists of spreaded data. In receiver part, use same PN sequence length logic to decode.Reverse operation, but both PN sequence sequence shouldbe synchronous