Package io.minio
Class Digest
java.lang.Object
io.minio.Digest
Various global static functions used.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringmd5Hash(byte[] data, int length) Returns MD5 hash of byte array.static Stringsha256Hash(byte[] data, int length) Returns SHA-256 hash of byte array.static Stringsha256Hash(String string) Returns SHA-256 hash of given string.static String[]sha256Md5Hashes(Object data, int len) Deprecated.This method is no longer supported.
-
Field Details
-
ZERO_MD5_HASH
- See Also:
-
ZERO_SHA256_HASH
- See Also:
-
-
Method Details
-
md5Hash
Returns MD5 hash of byte array.- Throws:
NoSuchAlgorithmException
-
sha256Hash
Returns SHA-256 hash of byte array.- Throws:
NoSuchAlgorithmException
-
sha256Hash
Returns SHA-256 hash of given string.- Throws:
NoSuchAlgorithmException
-
sha256Md5Hashes
@Deprecated public static String[] sha256Md5Hashes(Object data, int len) throws NoSuchAlgorithmException, IOException, InsufficientDataException, InternalException Deprecated.This method is no longer supported.Returns SHA-256 and MD5 hashes of given data and it's length.- Parameters:
data- must beRandomAccessFile,BufferedInputStreamor byte array.len- length of data to be read for hash calculation.- Throws:
NoSuchAlgorithmExceptionIOExceptionInsufficientDataExceptionInternalException
-