private static uint update_crc(uint crc, byte[] buf, int offset, int len) { uint c = crc; if (crc_table == null) make_crc_table(); for (int n = 0; n < len; n++) { c = crc_table[(c ^ buf[n + offset]) & 0xff] ^ (c >> 8); } return c; }