public class CRCUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
CRCUtil.HashCoder<T> |
Constructor and Description |
---|
CRCUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
calcCRC(byte[] arr)
Calculates a CRC for the byte array.
|
static long |
calcCRC(java.io.File file)
Calculates the CRC of a file.
|
static <T> long |
crc(java.util.Collection<T> items)
This is a convenience method that will use whatever T.hashCode() happens to be as the hash code.
|
static <T> long |
crc(java.util.Collection<T> items,
CRCUtil.HashCoder<T> hashCoder)
Calculates a reliably unique code for a given Collection
|
public static long calcCRC(byte[] arr)
arr
- public static long calcCRC(java.io.File file) throws java.io.IOException
java.io.IOException
public static <T> long crc(java.util.Collection<T> items)
crc(Collection, HashCoder)
public static <T> long crc(java.util.Collection<T> items, CRCUtil.HashCoder<T> hashCoder)
items
- The CollectionhashCoder
- The HashCoder that provides a hashCode for an object of T.