Home > database >  Beg a PLSQL CRC16 code, Java version is as follows.
Beg a PLSQL CRC16 code, Java version is as follows.

Time:10-10

/CRC - 16 * * * * CRC16_IBM: polynomial x15 x16 + + x2 + 1 (0 x8005), the initial value of 0 x0000, low before, and in the high results with 0 x0000 xor * 0 xa001 is 0 x8005 according to the result of a reverse * @ param @ return buffer * */public static int CRC16_IBM (byte [] buffer) {int wCRCin=0 x0000; Int wCPoly=0 xa001; For (byte b: buffer) {wCRCin ^=((int) b & amp; 0 x00ff); For (int j=0; J & lt; 8; J++) {if ((wCRCin & amp; 0 x0001)!=0) {wCRCin & gt;>=1; WCRCin ^=wCPoly; } else {wCRCin & gt;>=1; }}} return wCRCin ^=0 x0000; }

CodePudding user response:

Pray god to help
  • Related