com.mindbright.util
Class CRC32

java.lang.Object
  extended by com.mindbright.util.CRC32

public final class CRC32
extends java.lang.Object

static routine for calculating CRC32 (Cyclic Redundancy Check) checksums on data. Note that CRC32 is not cryptographically secure. A better alternative is SHA1 or MD5.

See Also:
MD5, SHA1

Field Summary
static long[] crc32_tab
          Table used to calculate CR32 checksums
 
Constructor Summary
CRC32()
           
 
Method Summary
static long getValue(byte[] buf, int off, int len)
          Calculate the CR32 value for a given blob of data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crc32_tab

public static final long[] crc32_tab
Table used to calculate CR32 checksums

Constructor Detail

CRC32

public CRC32()
Method Detail

getValue

public static long getValue(byte[] buf,
                            int off,
                            int len)
Calculate the CR32 value for a given blob of data

Parameters:
buf - array holding data to calculate checksum for
off - offset of data in buf
len - length of adata
Returns:
the CRC32 checksum