
top.hmtools.security.SHA512Tools Maven / Gradle / Ivy
package top.hmtools.security;
import java.io.File;
import java.io.InputStream;
import java.nio.charset.Charset;
import top.hmtools.security.SecurityTools.ESecurityName;
/**
* SHA-512算法工具
* @author Jianghaibo
*
*/
public class SHA512Tools {
private final static ESecurityName securityType = ESecurityName.SHA512;
/**
* 获取输入流的加密结果
*
20180315 通过了与Apache Commons codec 的计算结果比对
*
方法说明: getLowStr
*
输入参数说明:
*
@param inputStream
*
@return
*
输出参数说明:
*
String
*
*/
public static String getLowStr(InputStream inputStream) {
return SecurityTools.getLowStr(inputStream, securityType);
}
/**
* 获取文件的加密结果
*
20180315 通过了与Apache Commons codec 的计算结果比对
*
方法说明: getLowStr
*
输入参数说明:
*
@param file
*
@return
*
输出参数说明:
*
String
*
*/
public static String getLowStr(File file) {
return SecurityTools.getLowStr(file, securityType);
}
/**
* 获取字符串的加密结果
*
20180315 通过了与Apache Commons codec 的计算结果比对
*
方法说明: getLowStr
*
输入参数说明:
*
@param str
*
@return
*
输出参数说明:
*
String
*
*/
public static String getLowStr(String str) {
return SecurityTools.getLowStr(str, securityType);
}
/**
* 获取字节数组的加密结果
*
20180315 通过了与Apache Commons codec 的计算结果比对
*
方法说明: getLowStr
*
输入参数说明:
*
@param bytes
*
@return
*
输出参数说明:
*
String
*
*/
public static String getLowStr(byte[] bytes) {
return SecurityTools.getLowStr(bytes, securityType);
}
/**
* 获取字符串的加密结果
*
20180315 通过了与Apache Commons codec 的计算结果比对
*
方法说明: getLowStr
*
输入参数说明:
*
@param str
*
@param charset
*
@return
*
输出参数说明:
*
String
*
*/
public static String getLowStr(String str,Charset charset) {
return SecurityTools.getLowStr(str, charset,securityType);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy