# Class: com.pnfsoftware.jeb.util.encoding.Hash

Hash calculation routines. To calculate multiple hashes in a more efficient way, use [HashCalculator](HashCalculator) instead.

## Constructor: Hash


## Static Method: calculateCRC32
- parameter: `data`, type: `byte[]`
- return type: `int`

Description: Compute a CRC\-32 checksum for a byte array.
parameter: data: input bytes
return: CRC\-32 value, truncated to an `int`

## Static Method: calculateMD5
- parameter: `data`, type: `byte[]`
- return type: `byte[]`

Description: Compute an MD5 digest for a byte array.
parameter: data: input bytes
return: 16\-byte MD5 digest

## Static Method: calculateSHA1
- parameter: `data`, type: `byte[]`
- return type: `byte[]`

Description: Compute a SHA\-1 digest for a byte array.
parameter: data: input bytes
return: 20\-byte SHA\-1 digest

## Static Method: calculateSHA256
- parameter: `data`, type: `byte[]`
- return type: `byte[]`

Description: Compute a SHA\-256 digest for a byte array.
parameter: data: input bytes
return: 32\-byte SHA\-256 digest

## Static Method: checksumBlockFileUpdate
- parameter: `h`, type: `java.util.zip.Checksum`
- parameter: `f`, type: `java.io.File`

Description: Update a checksum with all bytes of a file.
parameter: h: checksum to update
parameter: f: input file
throws: if the file cannot be read

## Static Method: checksumBlockFileUpdate
- parameter: `h`, type: `java.util.zip.Checksum`
- parameter: `f`, type: `java.io.File`
- parameter: `offset`, type: `long`
- parameter: `size`, type: `long`

Description: Update a checksum with a byte range of a file.
parameter: h: checksum to update
parameter: f: input file
parameter: offset: start offset in the file
parameter: size: number of bytes to read
throws: if the file range cannot be read

## Static Method: checksumBlockFileUpdate
- parameter: `h`, type: `java.util.zip.Checksum`
- parameter: `raf`, type: `java.io.RandomAccessFile`
- parameter: `size`, type: `long`

Description: Update a checksum with bytes read from the current position of a random\-access file.
parameter: h: checksum to update
parameter: raf: input file, positioned at the start of the range
parameter: size: number of bytes to read
throws: if the requested byte range cannot be read

