Class Hash
java.lang.Object
com.pnfsoftware.jeb.util.encoding.Hash
Hash calculation routines. To calculate multiple hashes in a more efficient way, use
HashCalculator
instead.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
calculateCRC32
(byte[] data) static byte[]
calculateMD5
(byte[] data) static byte[]
calculateSHA1
(byte[] data) static byte[]
calculateSHA256
(byte[] data) static void
static void
checksumBlockFileUpdate
(Checksum h, File f, long offset, long size) static void
checksumBlockFileUpdate
(Checksum h, RandomAccessFile raf, long size)
-
Constructor Details
-
Hash
public Hash()
-
-
Method Details
-
calculateCRC32
public static int calculateCRC32(byte[] data) -
calculateMD5
public static byte[] calculateMD5(byte[] data) -
calculateSHA1
public static byte[] calculateSHA1(byte[] data) -
calculateSHA256
public static byte[] calculateSHA256(byte[] data) -
checksumBlockFileUpdate
- Throws:
IOException
-
checksumBlockFileUpdate
public static void checksumBlockFileUpdate(Checksum h, File f, long offset, long size) throws IOException - Throws:
IOException
-
checksumBlockFileUpdate
public static void checksumBlockFileUpdate(Checksum h, RandomAccessFile raf, long size) throws IOException - Throws:
IOException
-