private static ulong update_crc(ulong crc, byte[] buf, int len) { ulong c = crc; int n; if (!s_crc_table_computed) make_crc_table(); for (n = 0; n < len; n++) { c = s_crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8); } return c; }