Method and system for generating channel codes, in particular for a frame-header