public class Digest extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
md5Hash(Object data,
int len)
Returns MD5 hash of given data and it's length.
|
static String |
sha256Hash(Object data,
int len)
Returns SHA-256 hash of given data and it's length.
|
static String |
sha256Hash(String string)
Returns SHA-256 hash of given string.
|
static String[] |
sha256Md5Hashes(Object data,
int len)
Returns SHA-256 and MD5 hashes of given data and it's length.
|
public static String sha256Hash(String string) throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic static String sha256Hash(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.NoSuchAlgorithmExceptionIOExceptionInsufficientDataExceptionInternalExceptionpublic 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.NoSuchAlgorithmExceptionIOExceptionInsufficientDataExceptionInternalExceptionpublic static String md5Hash(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.NoSuchAlgorithmExceptionIOExceptionInsufficientDataExceptionInternalException