md5 sha256 加密
程序员文章站
2024-03-19 12:57:10
...
md5 sha256 加密
package com.lgcx.utils;
import org.apache.commons.codec.digest.DigestUtils;
public class EncryptionUtil {
public static final String PWD_KEY = "shamd5";//**
/**
* sha+MD5+**(不可逆)
*
* @param pwd
* @return
*/
public static String encryption(String pwd) {
String encPwd = DigestUtils.md5Hex(DigestUtils.sha256Hex(pwd) + PWD_KEY);
return encPwd;
}
public static void main(String[] args) {
String encryption = encryption("123");
System.out.println(encryption);
}
}
上一篇: iText导出pdf
下一篇: itext7生成PDF