if (!init)
{
init();
}
long crc_reg = 0;
for (byte aData : data)
{
int tmp = (int) (((crc_reg >>> 24) & 0xff) ^ u(aData));
crc_reg = (crc_reg << 8) ^ crc_lookup[tmp];
crc_reg &= 0xffffffff;
}
byte[] sum = new byte[4];
sum[0] = (byte) (crc_reg & 0xffL);
sum[1] = (byte) ((crc_reg >>> 8) & 0xffL);
sum[2] = (byte) ((crc_reg >>> 16) & 0xffL);
sum[3] = (byte) ((crc_reg >>> 24) & 0xffL);
return sum;