- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
for(int b = 0; b < len; b++){
resultByte[b] = (byte)(buf[b] & 0xFF);
crc32 ^= (buf[b] << 24);
if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
}
resultByte[len+3] = (byte)(crc32 & 0xFF);
resultByte[len+2] = (byte)((crc32 >>> 8) & 0xFF);
resultByte[len+1] = (byte)((crc32 >>> 16) & 0xFF);
resultByte[len] = (byte)((crc32 >>> 24) & 0xFF);
Elvenfighter 10.09.2018 14:43 # +1
MininN 10.09.2018 14:47 # +1
pedomud 10.09.2018 15:17 # −3
Elvenfighter 10.09.2018 15:24 # 0
2. s/byte/int/g
guest8 10.09.2018 15:32 # −999
guest8 10.09.2018 18:40 # −999
Arduino 10.09.2018 22:12 # 0