scrambler.c

来自「This model is just testing an idea of MI」· C语言 代码 · 共 26 行

C
26
字号
/*****************************************************************************//*   FIle Name : scrambler.c                                                 *//*   Description : WLAN FEC scrambler for Encoder/Decoder                    *//*                 S(x) = x^7 + x^4 + 1 ;                                    *//*   author : miffie                                                         *//*   Date   : aug/04/05                                                      *//*   Copyright (c) 2005 miffie   All rights reserved.                        *//*****************************************************************************/struct binaryset scrambler (struct binaryset datain, char seed) {int 	ii ;char 	shifter ;char 	tmp1, tmp2 ;char	*p ;  //Main     shifter = seed ;    p = datain.data ;    for(ii=0;ii<datain.size;ii++) { //for	tmp1 = (shifter &0x40) >> 6 ; 	tmp1 ^= (shifter &0x08) >> 3 ;         shifter = (shifter<<1) + tmp1 ;        *p++ ^= tmp1 ;    } //for    return ( datain ) ;} //scrambler

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?