Package org.compiere.utils
Class DigestOfFile
java.lang.Object
org.compiere.utils.DigestOfFile
- Author:
- rlemeill, Michael Judd BF [ 2736817 ] - remove deprecated BASE64Encoder classes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondigestAsBase64
(byte[] input) digestAsBase64
(File file) byte[]
digestAsByteArray
(byte[] input) byte[]
digestAsByteArray
(File file) digestAsHex
(byte[] input) digestAsHex
(File file) static String
getMD5Hash
(byte[] input) Get md5 hash from byte[]static String
getMD5Hash
(File file) static void
static boolean
md5HashCompare
(File file1, File file2)
-
Constructor Details
-
DigestOfFile
- Parameters:
algorithm
- ie MD5- Throws:
Exception
-
-
Method Details
-
digestAsByteArray
- Parameters:
file
- to hash- Returns:
- hash
- Throws:
Exception
-
digestAsByteArray
- Throws:
Exception
-
digestAsBase64
- Parameters:
file
-- Returns:
- hash (base64 encoded)
- Throws:
Exception
-
digestAsBase64
- Parameters:
input
-- Returns:
- hash (base64 encoded)
- Throws:
Exception
-
digestAsHex
- Parameters:
file
-- Returns:
- hex encoded md5 string
- Throws:
Exception
-
digestAsHex
- Parameters:
input
-- Returns:
- hex encoded md5 string
- Throws:
Exception
-
main
- Parameters:
args
- file
-
md5HashCompare
- Parameters:
file1
- first file to comparefile2
- second file to compare- Returns:
- true if files are identic false otherwise
-
getMD5Hash
- Parameters:
file
-- Returns:
- md5 hash null if file is not found or other error
-
getMD5Hash
Get md5 hash from byte[]- Parameters:
input
-- Returns:
- mdg hash string
-