public class Digest extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ZERO_MD5_HASH |
static String |
ZERO_SHA256_HASH |
Modifier and Type | Method and Description |
---|---|
static String |
md5Hash(byte[] data,
int length)
Returns MD5 hash of byte array.
|
static String |
sha256Hash(byte[] data,
int length)
Returns SHA-256 hash of byte array.
|
static String |
sha256Hash(String string)
Returns SHA-256 hash of given string.
|
static String[] |
sha256Md5Hashes(Object data,
int len)
Deprecated.
This method is no longer supported.
|
public static final String ZERO_MD5_HASH
public static final String ZERO_SHA256_HASH
public static String md5Hash(byte[] data, int length) throws NoSuchAlgorithmException
NoSuchAlgorithmException
public static String sha256Hash(byte[] data, int length) throws NoSuchAlgorithmException
NoSuchAlgorithmException
public static String sha256Hash(String string) throws NoSuchAlgorithmException
NoSuchAlgorithmException
@Deprecated public static String[] sha256Md5Hashes(Object data, int len) throws NoSuchAlgorithmException, IOException, InsufficientDataException, InternalException
data
- must be RandomAccessFile
, BufferedInputStream
or byte array.len
- length of data to be read for hash calculation.NoSuchAlgorithmException
IOException
InsufficientDataException
InternalException