Package com.luna.common.encrypt
Class EncryptUtils
java.lang.Object
com.luna.common.encrypt.EncryptUtils
- Author:
- luna@mac 2021年05月10日 14:27
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
byteArrayToHex
(byte[] byteArray) 字符数组组合成字符串返回static String
dataEncryptByJdk
(String input, String hashType) 获得一个字符串的encrypt值static String
encryptByCommonIo
(InputStream in, String hashType) Commons.io 获取md5值static String
encryptByCommonIo
(String data, String hashType) Commons.io 获取md5值static String
fileEncryptByJdk
(String path, String hashType) JDK 获取文件唯一值static String
md5Checksum
(String md5Prefix, String md5Postfix, String toDigest) 根据内容生成一串校验和static String
streamEncryptByJdk
(InputStream in, String hashType) JDK Md5输入流
-
Constructor Details
-
EncryptUtils
public EncryptUtils()
-
-
Method Details
-
md5Checksum
根据内容生成一串校验和- Parameters:
md5Prefix
- 指定前缀md5Postfix
- 指定后缀toDigest
- 原内容- Returns:
- 校验和
- Throws:
Exception
-
dataEncryptByJdk
获得一个字符串的encrypt值- Parameters:
input
- 输入的字符串- Returns:
- 输入字符串的MD5值
-
fileEncryptByJdk
JDK 获取文件唯一值- Parameters:
path
- 文件路径hashType
- 密文类型- Returns:
-
streamEncryptByJdk
JDK Md5输入流- Parameters:
in
-hashType
-- Returns:
-
byteArrayToHex
字符数组组合成字符串返回- Parameters:
byteArray
-- Returns:
-
encryptByCommonIo
Commons.io 获取md5值- Parameters:
in
-- Returns:
-
encryptByCommonIo
Commons.io 获取md5值- Parameters:
data
-- Returns:
-