package sdfg;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class sdfg {
public static String createMD5(String pw) throws NoSuchAlgorithmException
{
MessageDigest md;
md=MessageDigest.getInstance("SHA");
md.update(pw.getBytes());
String re=new BigInteger(1,md.digest()).toString(16);
return re;
}
public static void main(String[] args) throws NoSuchAlgorithmException
{
String pw="dfgdf";
System.out.println(createMD5(pw));
}
}
转载于:https://www.cnblogs.com/tiandsp/p/7467833.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)