A method for encoding of information, as well as devices with error correction and error detection