I have this byte array:
static byte[] buf = new byte[] { (byte) 0x01, (byte) 0x04, (byte)0x00, (byte)0x01,(byte)0x00, (byte) 0x01};
Now, th
Would CRC32 do, or does it have to be CRC16? If 32 is okay, have you tried using the CRC32
in java.util.zip
?
import java.util.zip.CRC32;
byte[] buf = new byte[] { (byte) 0x01, (byte) 0x04, (byte)0x00, (byte)0x01,(byte)0x00, (byte) 0x01};
CRC32 crc32 = new CRC32();
crc32.update(buf);
System.out.printf("%X\n", crc32.getValue());
The output is:
F9DB8E67
Then you can do whatever additional calculation you want on top of that.