code: public static long generate(long crc, byte []buffer, int offset, int len)
    {
      final long []crcTable = CRC_TABLE;
      
      for (int i = 0; i < len; i++) {
        final int index = ((int) crc ^ buffer[offset + i]) & 0xff;
        
        crc = (crc >>> 8) ^ crcTable[index];
      }
  
      return crc;
    }
docs: Calculates CRC from a char buffer