Package com.luna.common.encrypt
Class HashUtils
java.lang.Object
com.luna.common.encrypt.HashUtils
Md5加密方法
- Author:
- luna
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkFileWithMd5
(InputStream path, String md5) 检查输入流hashstatic boolean
checkFileWithMd5
(String path, String md5) 检查输入流hashstatic boolean
checkFileWithSHA256
(InputStream path, String sha256) 检查输入流hashstatic boolean
checkFileWithSHA256
(String path, String md5) 检查文件hashstatic String
md5
(InputStream inputStream) static String
获取文件或者字符串的MD5值static String
md5WithFile
(String path) static String
sha256
(InputStream inputStream) static String
static String
sha256WithFile
(String path)
-
Constructor Details
-
HashUtils
public HashUtils()
-
-
Method Details
-
md5
获取文件或者字符串的MD5值- Parameters:
data
-- Returns:
-
md5WithFile
-
md5
-
sha256
-
sha256WithFile
-
sha256
-
checkFileWithSHA256
检查输入流hash- Parameters:
path
- 文件路径sha256
- hash值- Returns:
-
checkFileWithSHA256
检查文件hash- Parameters:
path
- 文件路径md5
- md5值- Returns:
-
checkFileWithMd5
检查输入流hash- Parameters:
path
- 文件路径md5
- md5值- Returns:
-
checkFileWithMd5
检查输入流hash- Parameters:
path
- 文件路径md5
- md5值- Returns:
-