public static long calculateCRC32 ( byte [ ] buffer , int offset , int length ) { if ( ! init_done ) { initialize ( ) ; } for ( int i = offset ; i < offset + length ; i ++ ) { long tmp1 = ( crc >>> 8 ) & 0x00FFFFFF L ; long tmp2 = values [ ( int ) ( ( crc ^ Character . toUpperCase ( ( char ) buffer [ i ] ) ) & 0xff ) ] ; crc = tmp1 ^ tmp2 ; // System.out.println("CRC: "+crc); } return crc ; }
Calculates the CRC - 32 of a block of data all at once