public class HashUtil extends Object
| Constructor and Description |
|---|
HashUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getDigest(InputStream inputStream)
Calculates a base64 MD5 Hash for the content of an inputStream.
|
static String |
getDigest(String salt,
InputStream inputStream)
Calculates a base64 MD5 Hash for the content of an inputStream.
|
public static String getDigest(InputStream inputStream) throws NoSuchAlgorithmException, IOException
Mainly used for comparison of files. E.g. After PUTting a File to the Server, the Amazon S3-Client expects a base64 MD5 Hash, ETag, as part of the response Header to verify the validity of the transferred file.
inputStream - the InputStream.NoSuchAlgorithmException - if no md5 can be foundIOException - if InputStream can't be readpublic static String getDigest(String salt, InputStream inputStream) throws NoSuchAlgorithmException, IOException
Mainly used for comparison of files. E.g. After PUTting a File to the Server, the Amazon S3-Client expects a base64 MD5 Hash, ETag, as part of the response Header to verify the validity of the transferred file. For encrypted uploads, the returned hash may not be the same as the local client hash value.
salt - Optional salt to add to be digested, for simulating encryption dependent
hashing.inputStream - the InputStream.NoSuchAlgorithmException - if no md5 can be found.IOException - if InputStream can't be read.Copyright © 2019 Adobe. All rights reserved.