Package com.luna.common.encrypt
Class HashUtils
java.lang.Object
com.luna.common.encrypt.HashUtils
Md5加密方法
- Author:
- luna
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckFileWithMd5(InputStream path, String md5) 检查输入流hashstatic booleancheckFileWithMd5(String path, String md5) 检查输入流hashstatic booleancheckFileWithSHA256(InputStream path, String sha256) 检查输入流hashstatic booleancheckFileWithSHA256(String path, String md5) 检查文件hashstatic Stringmd5(InputStream inputStream) static String获取文件或者字符串的MD5值static Stringmd5WithFile(String path) static Stringsha256(InputStream inputStream) static Stringstatic Stringsha256WithFile(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:
-