java md5工具类
import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import sun.misc.BASE64Encoder; publicstaticStringmd5(String str){ MessageDigest md5; String jiustr = str; String xinstr = "" ; try{ md5 = MessageDigest.getInstance( "MD5"); byte[] bs = md5.digest(jiustr.getBytes()); BASE64Encoder encoder =newBASE64Encoder(); xinstr = encoder.encode(bs); }catch(NoSuchAlgorithmException e) { e.printStackTrace(); } returnxinstr; }
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/10816.html